You are viewing a single comment's thread. Return to all comments →
n = int(input()) e = sorted([2,3,5,7,11,13,31,37,17,71,73,79,97,113,131,311,197,971,719,199,991,919,337,373,733,1193,1931,9311,3119,3779,7793,7937,9377,11939,19391,93911,39119,91193,19937,99371,93719,37199,71993,193939,939391,393919,939193,391939,919393,199933,999331,993319,933199,331999,319993,]) res = 0 for i in e: if i <= n: res += i else: break print(res)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #35: Circular primes
You are viewing a single comment's thread. Return to all comments →
Python O(1) sol: