-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path69.py
More file actions
executable file
·39 lines (33 loc) · 759 Bytes
/
69.py
File metadata and controls
executable file
·39 lines (33 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import eulerfunctions
def phi(n):
count = 0
if n == 1:
return 1
first = set(eulerfunctions.primefac(n))
for foo in range(1, n):
second = set(eulerfunctions.primefac(foo))
if first.intersection(second) == set():
count += 1
return count
high = 0
highnum = 0
# for i in range(2, 1000001):
#
# if eulerfunctions.isPrime(i):
# x = i / phi(i)
# #print i," - ",phi(i)
# if x > high:
# high = x
# highnum = i
p = eulerfunctions.primegen()
for number, i in enumerate(p):
if number % 1000 == 0:
print
number, i
x = i / phi(i)
if x > high:
high = x
highnum = i
if i > 1000000:
break
print(highnum, high)