27
loading...
This website collects cookies to deliver better user experience
is_prime
to determine if a number is a prime. Then have a counter to find the 10,001st prime number.$ ./ch-1.py
104743
$ ./ch-1.pl
104743
get_parent
that will return the parent Fraction value given a Fraction value. It will return None if it has no parent (either -1/1 or 1/1). I also have a method called f
that generates a string to display as the Fractions str method, will not show the denominator if it is 1.$ ./ch-2.py 3/5
parent = '3/2' and grandparent is '1/2'
$ ./ch-2.py 4/3
parent = '1/3' and grandparent is '1/2'
$ ./ch-2.py 1/2
parent = '1/1' and grandparent is None