[go: up one dir, main page]

login
A372041
Least prime p such that the sum of squares of the 2n + 1 consecutive primes starting with p is prime, or -1 if no such p exists.
1
3, 3, 5, 3, 3, 5, -1, 5, 5, -1, 3, 7, -1, 3, 13, -1, 5, 5, -1, 7, 23, -1, 13, 5, -1, 7, 5, -1, 59, 29, 3, 3, 5, -1, 3, 5, -1, 13, 11, -1, 37, 23, -1, 43, 11, -1, 3, 5, -1, 11, 5, -1, 5, 19, -1, 5, 43, -1, 13, 29, -1, 7, 19, -1, 41, 47, -1, 13, 11, 3, 7, 5, -1, 29, 7, -1, 79, 13, 3, 3
OFFSET
1,1
COMMENTS
a(n) = 2 never occurs, since the sum starting at 2 is always even and >= 4, so not prime.
a(n) = 3 iff n is in A370633 (and equivalently iff 2*n+1 is in A071149).
For n == 1 (mod 3), so 2*n+1 is a multiple of 3, a(n) = 3 or -1, since all primes >= 5 are congruent to 1 (mod 6) so the sum starting at 5 or more is a multiple of 3 and so not prime.
EXAMPLE
a(6) = 5 because 5 is the smallest of 2*6+1 = 13 consecutive primes whose sum of squares = 5^2 + 7^2 + 11^2 + 13^2 + 17^2 + 19^2 + 23^2 + 29^2 + 31^2 + 37^2 + 41^2 + 43^2 + 47^2 = 10453 is prime.
a(7) = -1 because 7 == 1 (mod 3) so its only possibility is that the sum starts at 3, but 3^2 + ... + 53^2 = 13271 is not prime.
PROG
(PARI) a(n) = if ((n % 3) == 1, my(vp = primes(2*n+2)); if (isprime(sum(k=2, #vp, vp[k]^2)), return (3), return(-1)); ); my(vp = primes(2*n+2)); while(! isprime(sum(k=2, #vp, vp[k]^2)), vp = concat(setminus(vp, Set(vp[1])), nextprime(vp[2*n+2]+1))); vp[2]; \\ Michel Marcus, May 16 2024
CROSSREFS
Cf. A024450, A089793, A318351, A340771, A370633 (indices of 3's).
Sequence in context: A066670 A282270 A013606 * A206550 A284723 A190911
KEYWORD
sign
AUTHOR
Michel Lagneau, Apr 17 2024
STATUS
approved