cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059981 Order of compositeness for the n-th composite number.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Mar 06 2001

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A049076, A022449 (composites with compositeness 1).

Programs

  • 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} ]