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

Let q_n be least prime > x_n := 1 + 2*n!; sequence gives a(n) = q_n-x_n+1.
0

%I #9 Nov 21 2013 12:48:00

%S 3,3,5,5,11,7,11,11,29,29,13,71,29,19,19,37,23,23,41,29,53,53,89,29,

%T 41,41,59,227,79,41,101,73,61,41,37,59,67,127,67,223,71,43,53,71,71,

%U 113,239,71,313,157

%N Let q_n be least prime > x_n := 1 + 2*n!; sequence gives a(n) = q_n-x_n+1.

%F a(n)=nextprime(2*n!+1)-2*n!, where nextprime is A151800.

%e a(4) = 5 because 2*4!+1=49, the next prime is 51 and the difference between 53 and 48 is 13.

%t Do[If[PrimeQ[NextPrime[2*n!+1]-2*n! ], Print[n]], {n, 100}]

%t f[x_]:=Module[{n=2x!},NextPrime[n+1]-n]

%t f/@Range[60] (* _Harvey P. Dale_, Feb 14 2011 *)

%o (PARI) vector(100,n,nextprime(2*n!+2)-2*n!) \\ _Charles R Greathouse IV_, Feb 14 2011

%K hard,nonn

%O 1,1

%A Maciej Ulas (maciejulas(AT)poczta.onet.pl), Apr 25 2003