A089242 Sequence is S(infinity), where S(1) = 1, S(m+1) = concatenation S(m), a(m)+1, S(m) and a(m) is the m-th term of S(m). a(m) is also the m-th term of the sequence.
1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1
Offset: 1
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..65536
Programs
-
Mathematica
c[n_] := (i++; Block[{k = 0, m = n}, While[ EvenQ[m], k++; m /= 2]; k]); f[n_] := (i = 0; NestWhile[c, n, # >= 1 &]; i); Array[f, 105] (* Robert G. Wilson v, May 30 2006 *)
Formula
a(m) = number of c's such that 0 = c(c(c(c(...c(m)...)))), where 2^c(n) is the highest power of 2 which divides evenly into n (i.e., a(m) = 1 + a(c(m))); also c(m) = A007814(m).
In other words, a(n) = number of iterates of A007814 until a zero is encountered.
Multiplicative with a(2^e) = 1 + a(e), a(p^e) = 1 for odd prime p. - Andrew Howroyd, Jul 27 2018
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k>=1} a(2^(k-1))/2^k = 1.6980544744753405... . - Amiram Eldar, Oct 29 2022
Extensions
More terms from David Wasserman, Aug 31 2005
Comments