A092400 Fixed point of the morphism 1 -> 1121211, 2 -> 1121212121211, starting from a(1) = 1.
1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1
Offset: 1
Links
Programs
-
Mathematica
Nest[ Function[ l, {Flatten[(l /. {1 -> {1, 1, 2, 1, 2, 1, 1}, 2 -> {1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1}})]}], {1}, 3] (* Robert G. Wilson v, Feb 26 2005 *)
-
Python
from sympy import integer_log def A007417(n): def f(x): return n+x-sum(((m:=x//9**i)-2)//3+(m-1)//3+2 for i in range(integer_log(x,9)[0]+1)) m, k = n, f(n) while m != k: m, k = k, f(k) return m def A092400(n): return A007417(n)-A007417(n-1) if n>1 else 1 # Chai Wah Wu, Feb 16 2025
Formula
Sum_{k=1..n} a(k) = A007417(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 4/3. - Amiram Eldar, Apr 11 2025
Extensions
More terms from Robert G. Wilson v, Feb 26 2005
Comments