login
a(n) = (n-th odd prime + n-th odd nonprime)/2 - 1.
1

%I #18 Mar 31 2020 10:53:02

%S 1,6,10,15,18,21,25,28,33,37,42,45,48,51,57,61,64,70,73,76,81,84,89,

%T 94,97,100,105,109,113,121,124,128,130,136,139,144,148,153,157,161,

%U 163,171,173,177,179,187,195,198,201,204,210,212,218,222,228,234,236,240,243

%N a(n) = (n-th odd prime + n-th odd nonprime)/2 - 1.

%H G. C. Greubel, <a href="/A166160/b166160.txt">Table of n, a(n) for n = 1..5000</a>

%F a(n) = A005097(n) + A047845(n), where A005097 U A047845 = A001477.

%F a(n) = (A065091(n) + A014076(n))/2 - 1.

%p A065091 := proc(n) ithprime(n+1) ; end proc:

%p A014076 := proc(n) if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then return a ; end if; end do: end if; end proc:

%p A166160 := proc(n) (A065091(n)+A014076(n))/2-1 ; end proc: seq(A166160(n),n=1..120) ; # _R. J. Mathar_, May 21 2010

%t A014076 := Select[Range@250, ! PrimeQ@# && OddQ@# &]; A166160 := Prime[Range[2, 150]]; Table[(A166160[[n]] + A014076[[n]])/2 - 1, {n, 1, 50}] (* _G. C. Greubel_, Sep 17 2017 *)

%Y Cf. A001477, A005097, A014076, A047845, A065091.

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, Oct 09 2009

%E Entries checked by _R. J. Mathar_, May 21 2010