-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path37abc.py
More file actions
54 lines (43 loc) · 1.28 KB
/
37abc.py
File metadata and controls
54 lines (43 loc) · 1.28 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
length = 100
def clear(primesB, x):
delta = x
x = x + delta
while (x < length):
primesB[x] = False
x = x + delta
def next(primesB,x):
x = x +2
while (x < length and not primesB[x]):
x = x +2
return x
def getPrimesLessMillion():
primes = []
primesB = [True for x in range(0,length)]
primes.append(2)
clear(primesB,2)
z = 3
while(z < length):
primes.append(z)
clear(primesB,z)
z = next(primesB,z)
return primes
def left(x,primes):
subList = primes[0:x+1]
number = str(subList[x])
for x in range(0:len(number)):
def right(x,primes):
def getRoundPrimes();
primes = getPrimesLessMillion()
primes = primes[4:]
roundPrimes = []
for x in range(0:len(primes)):
if left(x,primes) and right(x,primes):
roundPrimes.append(prime[x])
if len(roundPrimes) == 11:
return roundPrimes
roundPrimes = getRoundPrimes();
print(roundPrimes)
summ = 0
for x in roundPrimes:
summ = summ + x
print(summ)