A063013 Numbers where k-th digit from right is either 0 or k.
0, 1, 20, 21, 300, 301, 320, 321, 4000, 4001, 4020, 4021, 4300, 4301, 4320, 4321, 50000, 50001, 50020, 50021, 50300, 50301, 50320, 50321, 54000, 54001, 54020, 54021, 54300, 54301, 54320, 54321, 600000, 600001, 600020, 600021, 600300, 600301, 600320, 600321
Offset: 0
Examples
a(11) = 4021 since 11 is written as 1011 in binary and the 1's can then be replaced by the relevant digits.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..511
Programs
-
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 *)
-
PARI
a(n) = fromdigits(Vec(Pol(binary(2*n))')); \\ Alan Michael Gómez Calderón, May 01 2025
Formula
a(n) = a(n-2^floor(log_2(n))) + floor(log_2(n)+1)*10^floor(log_2(n)).
Comments