OFFSET
1,3
COMMENTS
0 and 1 together with the composite numbers (A002808). - Omar E. Pol, Jul 04 2009
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..17739
FORMULA
a(1) = 0; a(n) = A018252(n-1), n > 1. - Omar E. Pol, Aug 13 2009
a(n) = A002808(n-2) for n > 2 . - Robert G. Wilson v, Jan 29 2015, corrected by Rémi Guillaume, Aug 26 2024.
MAPLE
A141468 := proc(n) option remember; local a; if n <=2 then n-1 ; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do; end if; end proc: # R. J. Mathar, Dec 13 2010
MATHEMATICA
nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; Array[ nonPrime, 66, 0] (* Robert G. Wilson v, Jan 29 2015 *)
Join[{0, 1}, Select[Range[100], CompositeQ]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 22 2017 *)
PROG
(Haskell)
a141468 n = a141468_list !! (n-1)
a141468_list = 0 : a018252_list -- Reinhard Zumkeller, May 31 2013
(PARI) a(n) = my(k=0); n--; while(-n+n+=-k+k=primepi(n), ); n; \\ Ruud H.G. van Tol, Jul 15 2024
(PARI) list(lim)=if(lim<1, return(if(lim<0, [], [0]))); my(v=List([0, 1])); forcomposite(n=4, lim\1, listput(v, n)); Vec(v) \\ Charles R Greathouse IV, Jul 15 2024
(Python)
from sympy import composite
def A141468(n): return n-1 if n < 3 else composite(n-2) # Chai Wah Wu, Oct 11 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 11 2008
EXTENSIONS
Added 68 by R. J. Mathar, Aug 14 2008
Better definition from Omar E. Pol, Jun 30 2009
STATUS
approved