OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
N. Fernandez, An order of primeness, F(p)
N. Fernandez, An order of primeness [cached copy, included with permission of the author]
FORMULA
Let C(n) be the n-th composite number, with C(1)=4. Then these are numbers C(C(n)).
a(n) = n + 2n/log n + O(n/log^2 n). - Charles R Greathouse IV, Jun 25 2017
EXAMPLE
MATHEMATICA
Select[ Range[ 6, 150 ], ! PrimeQ[ # ] && ! PrimeQ[ # - PrimePi[ # ] - 1 ] & ]
With[{cmps=Select[Range[200], CompositeQ]}, Table[cmps[[cmps[[n]]]], {n, 70}]] (* Harvey P. Dale, Feb 18 2018 *)
PROG
(Haskell)
a050435 = a002808 . a002808
a050435_list = map a002808 a002808_list
-- Reinhard Zumkeller, Jan 12 2013
(PARI) composite(n)=my(k=-1); while(-n + n += -k + k=primepi(n), ); n \\ M. F. Hasler
a(n)=composite(composite(n)) \\ Charles R Greathouse IV, Jun 25 2017
(Python)
from sympy import composite
def a(n): return composite(composite(n))
print([a(n) for n in range(1, 65)]) # Michael S. Branicky, Sep 12 2021
CROSSREFS
KEYWORD
easy,nonn,nice
AUTHOR
Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
EXTENSIONS
More terms from Robert G. Wilson v, Dec 20 2000
STATUS
approved