%I #16 Jun 16 2024 11:25:19
%S 1,3,7,11,14,19,25,29,32,37,43,51,52,57,65,72,75,76,79,83,99,104,105,
%T 114,115,125,128,133,139,149,152,153,175,178,179,182,187,197,202,207,
%U 212,213,221,231,244,247,248,251,269,278,279,287,299,304,307,312,319
%N a(n) = ((n-th nonprime)-th prime) - (n-th nonprime).
%H Harvey P. Dale, <a href="/A168285/b168285.txt">Table of n, a(n) for n = 1..2500</a>
%F a(n) = A000040(A018252(n)) - A018252(n) = A007821(n) - A018252(n).
%e The 1st nonprime is 1, the 1st prime is 2, so a(1) = 2 - 1 = 1.
%e The 2nd nonprime is 4, the 4th prime is 7, so a(2) = 7 - 4 = 3.
%p A018252 := proc(n) if n = 1 then 1; else for a from procname(n-1)+1 do if not isprime(a) then return a ; fi; od: fi; end proc: A168285 := proc(n) local c; c := A018252(n) ; ithprime(c)-c ; end proc: seq(A168285(n),n=1..100) ; # _R. J. Mathar_, Nov 30 2009
%t Prime[#]-#&/@Select[Range[100],!PrimeQ[#]&] (* _Harvey P. Dale_, Jun 16 2024 *)
%K nonn
%O 1,2
%A _Juri-Stepan Gerasimov_, Nov 22 2009
%E Name clarified by _Jon E. Schoenfield_, May 12 2019
|