login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338990 a(n) is the first prime p such that the sum of 2*n consecutive primes starting at p is (q-1)*q where q is prime, or 0 if there is no such p. 2

%I #10 Dec 21 2020 02:06:00

%S 19,61,17,8581,10883,151,2083,21859,11813,443,6779,1531,21559,37781,

%T 7529,757,29027,2591,12739,1637,491,4759,56269,341179,37441,81547,59,

%U 229,1814023,363523,12109,21493,247993,248089,3617,357551,3109,138563,66973,100103,6907,44819,136519,2953,13063,31687

%N a(n) is the first prime p such that the sum of 2*n consecutive primes starting at p is (q-1)*q where q is prime, or 0 if there is no such p.

%H Robert Israel, <a href="/A338990/b338990.txt">Table of n, a(n) for n = 1..306</a>

%e a(3) = 17 because the sum of the 2*3=6 consecutive primes starting at 17 is 17+19+23+29+31+37 = 156 = 12*13 where 13 is prime.

%p N:= 10^5:

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

%p S:= ListTools:-PartialSums([0, op(P)]):

%p nP:= nops(S):

%p f:= proc(n) local i;

%p for i from 1 to nP-n do

%p if issqr(1+4*(S[i+n]-S[i])) and isprime((sqrt(1+4*(S[i+n]-S[i]))+1)/2)then return P[i] fi

%p od;

%p FAIL

%p end proc:

%p R:= NULL:

%p for i from 1 do

%p v:= f(2*i);

%p if v = FAIL then break fi;

%p R:= R, v

%p od:

%p R;

%Y Cf. A338985, A338989.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Dec 20 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)