OFFSET
0,3
COMMENTS
a(511) = 987654321 is the last term.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..511
FORMULA
a(n) = a(n-2^floor(log_2(n))) + floor(log_2(n)+1)*10^floor(log_2(n)).
EXAMPLE
a(11) = 4021 since 11 is written as 1011 in binary and the 1's can then be replaced by the relevant digits.
MAPLE
a:= n-> (l-> parse(cat(seq(l[-i]*(1+nops(l)-i),
i=1..nops(l)))))(convert(n, base, 2)):
seq(a(n), n=0..2^6-1); # Alois P. Heinz, Oct 29 2018
MATHEMATICA
FromDigits /@ (Range[9, 1, -1]*# & /@ IntegerDigits[Range[0, 511], 2, 9]) (* Giovanni Resta, Oct 28 2018 *)
CROSSREFS
KEYWORD
base,nonn,fini,full
AUTHOR
Henry Bottomley, Jul 04 2001
STATUS
approved