A111287 a(n) = smallest k such that prime(n) divides Sum_{i=1..k} prime(i).
1, 10, 2, 5, 8, 49, 4, 23, 23, 7, 39, 29, 6, 10, 39, 25, 30, 151, 38, 19, 139, 27, 174, 21, 287, 422, 240, 24, 94, 22, 16, 173, 861, 231, 143, 140, 213, 902, 18, 134, 143, 310, 70, 58, 12, 550, 237, 210, 229, 57, 221, 271, 194, 540, 145, 718, 116, 184, 90, 14, 168, 455, 61, 454
Offset: 1
Keywords
Examples
A007504 begins 2,5,10,17,28,41,58,77,100,129,... and the k=10th term is the first one that is divisible by prime(2) = 3, so a(2) = 10 (see also A103208).
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- D. K. L. Shiu, Strings of Congruent Primes, J. Lond. Math. Soc. 61 (2) (2000) 359-373 [MR1760689]
Programs
-
Maple
read transforms; M:=1000; p0:=[seq(ithprime(i),i=1..M)]; q0:=PSUM(p0); w:=[]; for n from 1 to M do p:=p0[n]; hit := 0; for i from 1 to M do if q0[i] mod p = 0 then w:=[op(w),i]; hit:=1; break; fi; od: if hit = 0 then break; fi; od: w;
-
Mathematica
Table[p=Prime[n]; s=0; k=0; While[k++; s=Mod[s+Prime[k],p]; s>0]; k, {n,10}] (* T. D. Noe, Dec 02 2009 *)
-
PARI
A111287(n)= n=Mod(0,prime(n)); for(k=1,1e9, (n+=prime(k)) || return(k)) \\ M. F. Hasler, Nov 29 2009
Extensions
The comments are based on correspondence with Paul Pollack and a posting to sci.math by Fred Helenius.
Typo in reference fixed by David Applegate, Dec 18 2009
Comments