

A359323


a(n) is the first prime p such that the average of the nth powers of n consecutive primes starting with p is prime.


0



2, 3, 1531, 19, 631, 37, 41, 13, 670231, 614333, 11699, 11, 2447, 3049, 223, 13, 8353, 2531, 2203, 241, 3209, 5023, 52631, 461, 26723, 3307
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

a(27) > 2*10^8. The 27 consecutive primes starting at a(27) must all be congruent (mod 3).
a(28) = 8677, a(29) = 33349, a(30) = 67103.
a(27) > 10^11. Up to 10^11, the longest runs of consecutive primes that are congruent (mod 3) are all of length 25: 21549657539, ..., 21549658079 (all == 2 (mod 3), 43553959717, ..., 43553960299 (all == 1 (mod 3)), and 55989913757, ..., 55989914177 (all == 2 (mod 3)).  Jon E. Schoenfield, Dec 26 2022


LINKS



EXAMPLE

a(3) = 1531 because 1531, 1543 and 1549 are consecutive primes and (1531^3 + 1543^3 + 1549^3)/3 = 3659642149 is prime, and 1531 is the least prime that works.


MAPLE

g:= proc(n) local P, s, i;
P:= <seq(ithprime(i), i=1..n)>;
s:= add(P[i]^n, i=1..n)/n;
do
if s::integer and isprime(s) then return P[1] fi;
s:= s  P[1]^n/n;
P[1..2] := P[2..1]; P[n]:= nextprime(P[n]);
s:= s + P[n]^n/n;
od
end proc:
map(g, [$1..26]);


PROG

(Python)
from sympy import prime, isprime, nextprime, primerange
def a(n):
plst = list(primerange(2, prime(n)+1))
powsum = sum(p**n for p in plst)
while True:
q, r = divmod(powsum, n)
if r == 0 and isprime(q): return plst[0]
powsum = plst[0]**n
plst = plst[1:] + [nextprime(plst[1])]
powsum += plst[1]**n


CROSSREFS



KEYWORD

nonn,more


AUTHOR



STATUS

approved



