diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2014-08-31 20:21:45 +0200 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2014-08-31 20:35:09 +0200 |
| commit | 95341b61b030c9e1290f3b326cb7ec584f543aea (patch) | |
| tree | 852386fa04d32eb859bca11c0eff7b5ef9e50f00 /069_2.py | |
| parent | 571164d977f91925c4c76a292f74f5f93d09ae23 (diff) | |
Diffstat (limited to '069_2.py')
| -rw-r--r-- | 069_2.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/069_2.py b/069_2.py new file mode 100644 index 0000000..c00483b --- /dev/null +++ b/069_2.py @@ -0,0 +1,22 @@ +# +# n/phi(n) is a maximum, if phi(n) is minimal +# +# phi(n) = n*(1-1/p1)*(1-1/p2)*...*(1-1/pi) +# n/phi(n) = 1/((1-1/p1)*(1-1/p2)*...*(1-1/pi)) +# -> smallest primes +# + +from common import sieve + +primes = sieve(100).primes() +prime_list = [ x for x in primes ] +prime_list.sort() + +x = 1 +for p in prime_list: + if x*p > 1000000: + break + x *= p + +print x + |
