login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A346215
a(n) is the start of the first maximal string of n consecutive primes such that the sum of squares of pairs of consecutive primes in the string is always divisible by 10.
0
2, 53, 7, 17, 347, 373, 3181, 431, 1511, 61, 2213, 14551, 32779, 12841, 23911, 31121, 1764349, 90001, 3037297, 5031121, 5934899, 17385223, 63052261, 23673281, 80690807, 1191279451, 7594193, 850110593, 300482639, 23554787897, 8785664509, 20835779213, 165645916039
OFFSET
1,1
EXAMPLE
a(4) = 17 because the four consecutive primes 17, 19, 23, 29 have 17^2 + 19^2, 19^2 + 23^2, 23^2 + 29^2 are all divisible by 10, and this is maximal because 13^2 + 17^2 and 29^2 + 31^2 are not divisible by 10.
MAPLE
P:= select(isprime, [2, seq(i, i=3..10^7, 2)]):
N:= nops(P):
R:= select(t -> P[t]^2 + P[t+1]^2 mod 10 = 0, [$1..N-1]):
nR:=nops(R):
V:= Vector(100): V[1]:= 2:
state:= 1: p:= P[R[1]];
for i from 2 to nR do
if R[i] = R[i-1]+1 then state:= state+1
else if V[state+1] = 0 then V[state+1]:= p fi;
state:= 1;
p:= P[R[i]];
fi
od:
V:= convert(V, list):
member(0, V, 'm'):
V[1..m-1];
CROSSREFS
Sequence in context: A248987 A179616 A200087 * A139841 A167771 A062853
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Aug 22 2021
EXTENSIONS
a(22)-a(33) from Martin Ehrenstein, Sep 01 2021
STATUS
approved