login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A024011
Numbers k such that the k-th prime divides the sum of the first k primes.
10
1, 3, 20, 31464, 22096548, 1483892396791177
OFFSET
1,2
COMMENTS
a(6) > pi(10^12) = 37607912018. - Jon E. Schoenfield, Sep 11 2008
a(6) > pi(10^14) = 3204941750802. - Giovanni Resta, Jan 09 2014
a(7) > 6.5*10^15. - Paul W. Dyson, Sep 27 2022
EXAMPLE
The third prime, 5, divides 2 + 3 + 5 = 10, so 3 is in the sequence.
2 + 3 + 5 + 7 = 17, which is not divisible by the fourth prime, 7, so 4 is not in the sequence.
MATHEMATICA
s = 0; For[i = 1, i <= 5 * 10^7, i++, s = s + Prime[i]; If[Mod[s, Prime[i + 1]] == 0, Print[i + 1]]]
With[{prs = Prime[Range[221000000]]}, PrimePi /@ Transpose[Select[ Thread[ {Accumulate[prs], prs}], Divisible[#[[1]], #[[2]]] &]][[2]]] (* Harvey P. Dale, Jul 23 2013 *)
nMax = 50000; primeSums = Accumulate[Prime[Range[nMax]]]; Select[Range[nMax], Divisible[primeSums[[#]], Prime[#]] &] (* Alonso del Arte, Nov 11 2019 *)
PROG
(PARI) s=0; t=0; for(w=2, 1000000000, if(isprime(w), s=s+w; t=t+1; if(s%w, print(t)), ))
CROSSREFS
KEYWORD
nonn,nice,hard,more
EXTENSIONS
a(5) from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 14 2000
a(6) from Paul W. Dyson, Apr 16 2022
STATUS
approved