A284157 Least index k such that (Sum_{i=1..k} prime(i)) mod prime(k) = n.
1, 8, 2, 4, 8094, 11, 5, 7, 9, 43, 16, 30, 12, 10, 134, 621, 2902940711, 32, 86124, 3097, 715, 83, 142034741, 14
Offset: 0
Examples
a(13) = 10 because the sum of the first 10 primes is 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 = 129 and 129 mod 29 = 13.
Links
- Giovanni Resta, Terms for n <= 120 (some missing)
Programs
-
Maple
P:=proc(q) local a,k,n; for n from 1 to q do a:=0; for k from 1 to q do a:=a+ithprime(k); if a mod ithprime(k)=n then print(k); break; fi; od; od; end: P(10^9);
-
Mathematica
a[n_] := Block[{s = 2, p = 2, i = 1}, While[Mod[s, p] != n, i++; p = NextPrime@ p; s += p]; i]; a /@ Range[0, 15] (* Giovanni Resta, Mar 22 2017 *)
Extensions
a(0), a(16), a(18), a(22) from Giovanni Resta, Mar 22 2017
Comments