|
|
A064187
|
|
First of n^2 consecutive odd primes whose sum (=S) is divisible by n and S/n == n (mod 2).
|
|
1
|
|
|
3, 5, 23, 5, 13, 7, 7, 79, 37, 23, 67, 89, 13, 89, 131, 31, 71, 47, 43, 73, 277, 353, 41, 67, 127, 223, 79, 13, 193, 5, 23, 43, 5, 67, 3, 19, 5, 59, 59, 653, 19, 19, 97, 409, 5, 383, 29, 137, 379, 349, 653, 1187, 47, 41, 37, 17, 619, 89, 283, 283, 43, 479, 191
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
A necessary condition for the existence of a magic square consisting of n^2 consecutive odd primes.
|
|
LINKS
|
|
|
EXAMPLE
|
a(5)=13 since 13+17+ ... +113 = 1565 = 5*313 and 313 == 5 (mod 2).
|
|
MAPLE
|
P:= select(isprime, [seq(i, i=3..10^6, 2)]):
nP:= nops(P):
PS:= [0, op(ListTools:-PartialSums(P))]:
f:= proc(n) local i, s;
for i from 1 to nP+1-n^2 do
s:= PS[i+n^2]-PS[i];
if s mod n = 0 and (s/n - n) mod 2= 0 then return P[i] fi
od;
FAIL
end proc;
|
|
PROG
|
(PARI) for(n=1, 50, k=2; m=n^2; aflag=0; while(k+m<=500000&&aflag==0, s=0; for(x=k, k+m-1, s=s+prime(x)); if(s%n==0&&(s/n)%2==n%2, print1(prime(k), ", "); aflag=1); k++))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
H. K. Gottlob Maier (1korrago(AT)freenet.de), Sep 20 2001
|
|
STATUS
|
approved
|
|
|
|