OFFSET
1,4
COMMENTS
Let c(k) = k-th composite number, let S(c) = S(c(k)) = k, the subscript of c; a(n) = order of compositeness of c(n) = 1+m where m is largest number such that S(S(..S(c(n))...)) with m S's is a composite.
Number of steps in the composite index chain for the n-th composite. - Daniel Forgues, Sep 28 2012
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
EXAMPLE
16 is 9th composite number, so S(16)=9, 9 is 4th composite, so S(S(16))=4, 4 is first composite number, so S(S(S(16)))=1, not a composite number. Thus a(9)=3.
4 is the first composite number, so S(4)=1, not a composite number. Thus a(1)=1.
MATHEMATICA
Composite[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k != n + PrimePi[ k ] + 1, k++ ]; k); CompositePi[ n_Integer ] := (n - 1 - PrimePi[ n ]); Attributes[ Composite ] = Attributes[ CompositePi ] = Listable; Table[ c = 1; k = CompositePi[ Composite[ n ] ]; While[ ! (PrimeQ[ k ] || k == 1), k = CompositePi[ k ]; c++ ]; c, {n, 100} ]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Robert G. Wilson v, Mar 06 2001
STATUS
approved