A162213 a(n) = the smallest positive multiple of n with exactly n digits when written in binary.
1, 2, 6, 8, 20, 36, 70, 128, 261, 520, 1034, 2052, 4108, 8204, 16395, 32768, 65552, 131076, 262162, 524300, 1048593, 2097172, 4194326, 8388624, 16777225, 33554456, 67108878, 134217748, 268435484, 536870940, 1073741854, 2147483648
Offset: 1
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
Programs
-
Maple
a := proc (n) local k: for k while nops(convert(k*n, base, 2)) <> n do end do; k*n end proc: seq(a(n), n = 1 .. 24); # Emeric Deutsch, Jul 10 2009 a:= n-> n*ceil(2^(n-1)/n): seq(a(n), n=1..40); # Alois P. Heinz, Jul 11 2009
-
Mathematica
Array[# Ceiling[2^(# - 1)/#] &, 32] (* Michael De Vlieger, Nov 04 2017 *)
Formula
a(n) = n * ceiling(2^(n-1)/n). - Alois P. Heinz, Jul 11 2009
Extensions
More terms from Emeric Deutsch and Alois P. Heinz, Jul 11 2009