login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A059981
Order of compositeness for the n-th composite number.
6
1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 4, 1, 3, 1, 2, 4, 2, 1, 3, 4, 5, 2, 4, 1, 2, 1, 3, 5, 3, 2, 4, 1, 5, 6, 3, 1, 5, 1, 2, 3, 2, 1, 4, 6, 4, 3, 5, 1, 2, 6, 7, 4, 2, 1, 6, 1, 2, 3, 4, 3, 2, 1, 5, 7, 5, 1, 4, 1, 6, 2, 3, 7, 8, 1, 5, 3, 2, 1, 7, 2, 3, 4
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
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
Cf. A049076, A022449 (composites with compositeness 1).
Sequence in context: A366521 A348581 A124044 * A033676 A095165 A355366
KEYWORD
easy,nonn
AUTHOR
Robert G. Wilson v, Mar 06 2001
STATUS
approved