A141468 Zero together with the nonprime numbers A018252.
0, 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88
Offset: 1
Keywords
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..17739
Programs
-
Haskell
a141468 n = a141468_list !! (n-1) a141468_list = 0 : a018252_list -- Reinhard Zumkeller, May 31 2013
-
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 *)
-
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
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.
Extensions
Added 68 by R. J. Mathar, Aug 14 2008
Better definition from Omar E. Pol, Jun 30 2009
Comments