p100=[1,2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97,1] p500=[1,2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,1] for p1 in p100: m1=1-1.0/p1 if m1<0.5: m1+=1.0 for p2 in p100[p100.index(p1)+1:]: m2=1-1.0/p2 if m2<0.5: m2+=1.0 for p3 in p100[p100.index(p2)+1:]: m3=1-1.0/p3 if m3<0.5: m3+=1.0 for p4 in p100[p100.index(p3)+1:]: m4=1-1.0/p4 if m4<0.5: m4+=1.0 for p5 in p100[p100.index(p4)+1:]: m5=1-1.0/p5 if m5<0.5: m5+=1.0 for p6 in p100[p100.index(p5)+1:]: print(p6) m6=1-1.0/p6 if m6<0.5: m6+=1.0 for p7 in p500[p100.index(p6)+1:]: m7=1-1.0/p7 if m7<0.5: m7+=1.0 for mult in range(1,2000): n=p1*p2*p3*p4*p5*p6*p7*mult if n>10000000: continue tn =int((n*m1*m2*m3*m4*m5*m6*m7)+0.01) if sorted(str(n))==sorted(str(tn)): print(p1,p2,p3,p4,p5,p6,p7) print (n,tn, n/float(tn))
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question