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(1)=1. a(n) = the smallest odd integer > a(n-1) such that a(n)*2 - a(n-1) is prime.
2

%I #15 Sep 02 2023 18:52:05

%S 1,3,5,9,11,15,17,23,27,29,33,35,39,41,47,53,57,59,63,65,69,71,75,77,

%T 83,93,95,99,101,105,107,117,127,129,133,135,137,143,147,149,153,155,

%U 159,161,167,173,177,179,185,189,191,195,197,213,221,225,227,233,237,239

%N a(1)=1. a(n) = the smallest odd integer > a(n-1) such that a(n)*2 - a(n-1) is prime.

%H Robert Israel, <a href="/A164121/b164121.txt">Table of n, a(n) for n = 1..10000</a>

%p R:= 1; x:= 1: count:= 1:

%p for y from x+2 by 2 do

%p if isprime(2*y-x) then

%p R:= R, y; x:= y; count:= count+1;

%p if count = 100 then break fi;

%p fi

%p od:

%p R; # _Robert Israel_, Mar 22 2023

%t soi[a_]:=Module[{k=a+2},While[!PrimeQ[2k-a],k=k+2];k]; NestList[soi,1,60] (* _Harvey P. Dale_, Sep 02 2023 *)

%Y Cf. A164122.

%K nonn

%O 1,2

%A _Leroy Quet_, Aug 10 2009

%E More terms from _R. J. Mathar_, Oct 24 2009