OFFSET
1,2
COMMENTS
Not the same as A096299, since a(1023) = 1234567900 which is not in lexicographic order. - Ralf Stephan, May 17 2007
LINKS
David A. Corneth, Table of n, a(n) for n = 1..16383
FORMULA
G.f.: 1/(1-x) * Sum_{k>=0} (10^(k+1) - 1)/9 * x^2^k/(1 + x^2^k). - Ralf Stephan, May 17 2007
a(n) = 10*a(floor(n/2)) + A000120(n) = Sum_{k=0..floor(log_2(n))} A000120(floor(n/(2^k)))*10^k. - Mikhail Kurkov, May 08 2019
MATHEMATICA
Nest[Append[#1, 10 #1[[Floor[#2/2] ]] + DigitCount[#2, 2, 1]] & @@ {#, Length[#] + 1} &, {1}, 36] (* Michael De Vlieger, Mar 12 2021 *)
PROG
(PARI) a(n) = sum(k=0, log(n)\log(2), hammingweight(n\(2^k))*10^k); \\ Michel Marcus, May 09 2019
(PARI) a(n) = my(b = Vecrev(binary(n))); sum(i = 1, #b, b[i] * 10^i-1) \ 9 + (vecmin(b) == 0) \\ David A. Corneth, May 19 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Jul 25 2005
STATUS
approved