-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path92.py
More file actions
executable file
·34 lines (30 loc) · 728 Bytes
/
92.py
File metadata and controls
executable file
·34 lines (30 loc) · 728 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
falseset = {1}
trueset = {89}
def schain(x):
# print ('Checking',x,'.')
tset = set()
global falseset
global trueset
while True:
#print (x,'->',end='')
if x in trueset or x == 89:
#print ('is in true cache.')
for num in tset:
trueset.add(num)
return True
elif x in falseset or x == 1:
#print ('is in False cache.')
for num in tset:
falseset.add(num)
return False
tset.add(x)
t = 0
for i in str(x):
t += int(i) ** 2
x = t
runsum = 0
for i in range(2, 10000000):
if i % 10000 == 0:
print('#', i)
schain(i)
print(runsum)