cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A111441 Numbers k such that the sum of the squares of the first k primes is divisible by k.

Original entry on oeis.org

1, 19, 37, 455, 509, 575, 20597, 202717, 1864637, 542474231, 1139733677, 51283502951, 230026580777, 22148897608321, 51271840444039, 1820988137264459
Offset: 1

Views

Author

Stefan Steinerberger, Nov 14 2005

Keywords

Comments

a(16) > 10^14 if it exists. - Anders Kaseorg, Dec 02 2020
Conjecture: There are no terms that are 3 or 9 modulo 12. This seems to hold for all related sequences with even powers of primes, not just squares. Compare "sums of powers of primes divisibility sequences", linked below. - Daniel Bamberger, Dec 03 2020
From Jacob Christian Munch-Andersen, Dec 13 2020: (Start)
Any prime except 3 raised to the 2nd power is 1 modulo 3. Therefore adding the squared primes together results in a simple periodic pattern modulo 3. Any term that is 0 modulo 3 would imply that it divides a number that is 2 modulo 3; as this is impossible there cannot be any terms divisible by 3.
The same proof indeed holds for similar lists generated with any even power, and a similar proof for instance disqualifies any multiple of 5 from the similar 4th-power list. A slightly simpler similar proof shows that there are no terms divisible by 2.
(End)
The previous comment implies that for a list generated with the m-th power, there are no terms divisible by p when p is prime and p-1 is a divisor of m. For example, the 12th power list has no terms divisible by 2, 3, 5, 7 or 13. - Paul W. Dyson, Jan 09 2021
The periodic pattern of the sum of primes raised to an even power as described in the comments above follows from Fermat's little theorem. When the pattern is periodic for a given p it can be seen that when k mod p = 0 the sum mod p = p-1 and therefore sum mod k cannot be 0. - Bruce Garner, Apr 08 2021
a(2) is also a value in each of the lists generated with the powers 20, 38, 56... . a(3) is also a value in each of the lists generated with the powers 38, 74, 110... . In general, if the sum of the first k primes each to the power of m is divisible by k, and m >= the maximum exponent in the prime factorization of k, then the sum of the first k primes each to the power of m + j * psi(k) is also divisible by k, where psi(k) is the reduced totient function (A002322) and j is any positive integer. This follows from the fact that n^m == n^(m + psi(k)) (mod k) for all integers n and all integers m >= the maximum exponent in the prime factorization of k. - Paul W. Dyson, Dec 09 2022
a(17) > 8*10^15. - Paul W. Dyson, Jan 16 2025

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.
		

Crossrefs

Cf. also A217599, A217600 for the corresponding prime numbers and sums.

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