A111441 Numbers k such that the sum of the squares of the first k primes is divisible by k.
1, 19, 37, 455, 509, 575, 20597, 202717, 1864637, 542474231, 1139733677, 51283502951, 230026580777, 22148897608321, 51271840444039, 1820988137264459
Offset: 1
Examples
The sum of the squares of the first 19 primes 2^2 + 3^2 + 5^2 + ... + 67^2 = 19*1314, thus 19 is in the sequence.
Links
- OEIS Wiki, Sums of powers of primes divisibility sequences.
- Matt Parker, MPMSolutions: The 19 Challenge, YouTube video, 2020 (challenge asking for terms of this sequence).
- Wikipedia, Fermat's little theorem
Crossrefs
Programs
-
Mathematica
s = 0; t = {}; Do[s = s + Prime[n]^2; If[ Mod[s, n] == 0, AppendTo[t, n]], {n, 10^6}]; t (* Robert G. Wilson v, Nov 15 2005 *) Module[{nn=2*10^6,pr2},pr2=Accumulate[Prime[Range[nn]]^2];Select[Thread[{Range[nn],pr2}],Divisible[#[[2]],#[[1]]]&]][[;;,1]] (* The program generates the first 9 terms of the sequence. *) (* Harvey P. Dale, May 25 2025 *)
-
MuPAD
a := 0; for n from 1 to 100000 do a := a + ithprime(n)^2; if a/n = trunc(a/n) then print(n); end_if; end_for;
-
PARI
for(n=1, 2*10^11, m=n; s=0; while(m>0, s=s+prime(m)^2; m--); if(s%n==0, print1(n, ", "))) \\ Felix Fröhlich, Jul 07 2014
-
PARI
isok(n) = norml2(primes(n)) % n == 0; \\ Michel Marcus, Nov 25 2020
Extensions
a(8)-a(9) from Robert G. Wilson v, Nov 15 2005
a(10)-a(11) from Ryan Propper, Mar 27 2007
a(12) from Robert Price, Mar 19 2013
a(13) from Balázs Dura-Kovács, Nov 25 2020
a(14) from Balázs Dura-Kovács, Nov 30 2020
a(15) from Anders Kaseorg, Dec 02 2020
a(16) from Jonas Lippuner, Aug 23 2021
Comments