%I #42 Mar 15 2022 07:01:36
%S 1,3,4,6,8,9,11,13,15,17,18,20,22,24,26,28,30,31,33,35,37,39,41,43,45,
%T 47,49,51,52,54,56,58,60,62,64,66,68,70,72,74,76,77,79,81,83,85,87,89,
%U 91,93,95,97,99,101,103,105,107,109,110,112,114,116,118,120
%N Connell-like sequence.
%H Nathaniel Johnston, <a href="/A193732/b193732.txt">Table of n, a(n) for n = 1..10000</a>
%e Let prime(n) denote the n-th prime.
%e Because prime(1)=2, take first 2 odd numbers giving a(1)=1, a(2)=3.
%e Because prime(2)=3, take 3 even numbers starting with 4 giving a(3)=4, a(4)=6, a(5)=8.
%e Because prime(3)=5, take 5 odd numbers starting with 9 giving a(6)=9, a(7)=11, a(8)=13, a(9)=15, a(10)=17.
%e Because prime(4)=7, take 7 even numbers starting with 18 gives a(11)=18, a(12)=20, ..., a(17)=30 etc.
%p cp:=2:ct:=1:a := proc(n) option remember: global cp,ct: if(n=1)then return 1: elif(ct=cp)then ct:=1:cp:=nextprime(cp): return a(n-1)+1: else ct:=ct+1: return a(n-1)+2: fi: end: seq(a(n),n=1..100); # _Nathaniel Johnston_, Aug 11 2011
%t nxt[{p_,a_}]:={NextPrime[p],Range[Last[a]+1,Last[a]+2*NextPrime[p],2]}; Transpose[NestList[nxt,{2,{1,3}},10]][[2]]//Flatten (* _Harvey P. Dale_, Mar 23 2016 *)
%Y Cf. A000040, A001614.
%K nonn,easy
%O 1,2
%A _Ctibor O. Zizka_, Aug 08 2011