A178243 a(2n) = a(n), a(2n+1) = 10*a(n) + a(n+1).
1, 1, 11, 1, 21, 11, 111, 1, 31, 21, 221, 11, 221, 111, 1111, 1, 41, 31, 331, 21, 431, 221, 2221, 11, 331, 221, 2321, 111, 2221, 1111, 11111, 1, 51, 41, 441, 31, 641, 331, 3331, 21, 641, 431, 4531, 221, 4431, 2221, 22221, 11, 441, 331, 3531, 221, 4531, 2321, 23321
Offset: 1
Examples
a(6) = a(3) = 10 since a(2n) = a(n); a(7) = 111 = 10*a(n) + a(n+1) = 10*11 + 1.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[1] = 1; a[n_] := a[n] = If[EvenQ@ n, a[n/2], 10 a[(n - 1)/2] + a[(n - 1)/2 + 1]]; Array[a, 55] (* Michael De Vlieger, May 20 2017 *)
Formula
a(2n) = a(n), a(2n+1) = 10*a(n) + a(n+1) = row 10 in the array of A178239.
Let M = an infinite lower triangular matrix with (1, 1, 10, 0, 0, 0,...) in each column, shifted down twice from the previous column. This sequence is Lim_{n->inf} M^n, the left-shifted vector considered as a sequence.
Extensions
More terms from Ilya Gutkovskiy, May 18 2017
Comments