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”).

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

%I #39 Sep 04 2021 08:26:33

%S 2,53,7,17,347,373,3181,431,1511,61,2213,14551,32779,12841,23911,

%T 31121,1764349,90001,3037297,5031121,5934899,17385223,63052261,

%U 23673281,80690807,1191279451,7594193,850110593,300482639,23554787897,8785664509,20835779213,165645916039

%N 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.

%e 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.

%p P:= select(isprime,[2,seq(i,i=3..10^7,2)]):

%p N:= nops(P):

%p R:= select(t -> P[t]^2 + P[t+1]^2 mod 10 = 0, [$1..N-1]):

%p nR:=nops(R):

%p V:= Vector(100): V[1]:= 2:

%p state:= 1: p:= P[R[1]];

%p for i from 2 to nR do

%p if R[i] = R[i-1]+1 then state:= state+1

%p else if V[state+1] = 0 then V[state+1]:= p fi;

%p state:= 1;

%p p:= P[R[i]];

%p fi

%p od:

%p V:= convert(V,list):

%p member(0,V,'m'):

%p V[1..m-1];

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Aug 22 2021

%E a(22)-a(33) from _Martin Ehrenstein_, Sep 01 2021