login
Order of compositeness for the n-th composite number.
6

%I #18 Mar 12 2015 18:42:27

%S 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,

%T 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,

%U 7,5,1,4,1,6,2,3,7,8,1,5,3,2,1,7,2,3,4

%N Order of compositeness for the n-th composite number.

%C 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.

%C Number of steps in the composite index chain for the n-th composite. - _Daniel Forgues_, Sep 28 2012

%H T. D. Noe, <a href="/A059981/b059981.txt">Table of n, a(n) for n = 1..1000</a>

%e 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.

%e 4 is the first composite number, so S(4)=1, not a composite number. Thus a(1)=1.

%t 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} ]

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

%K easy,nonn

%O 1,4

%A _Robert G. Wilson v_, Mar 06 2001