There are two primes, both below 100, that evenly divide the sum of the primes less than themselves.
Find those two primes.
The only other such prime below 2,000,000 is M, the n-th prime.
Find M and n.
10 while p<20000000
20 p=nxtprm(p)
30 inc n
40 if sum @ p = 0 then print p,n,sum,sum//p
50 sum=sum+p
60 wend
finds
prime n sum of prev multiple
2 1 0 0
5 3 5 1
71 20 568 8
369119 31464 5536785000 15000
So the two primes of the first part are 5 and 71, as, presumably, 2 doesn't count even though it "divides" zero evenly.
For the second part, M is 369,119 and n is 31,464. The sum of the first 31,463 primes is 5,536,785,000, which is 15,000 times 369,119.
BTW the program checks up to 20,000,000 and doesn't find another case.
|
Posted by Charlie
on 2012-02-12 18:26:57 |