OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = (n+1) * (2^BL(n) - 1), where BL(n) is the binary length of n.
MAPLE
a:= n-> (n+1)*(2^(ilog2(n)+1)-1):
seq(a(n), n=1..50); # Alois P. Heinz, Jan 08 2015
MATHEMATICA
Array[(# + 1) (2^(Floor@ Log2[#] + 1) - 1) &, 50] (* Michael De Vlieger, Oct 13 2018 *)
PROG
(Python)
for n in range(1, 333):
print(str((n+1)*(2 ** int.bit_length(int(n))-1)), end=', ')
(PARI) a(n) = (n+1)*(2^#binary(n)-1); \\ Michel Marcus, Jan 08 2015
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Alex Ratushnyak, Jan 05 2015
STATUS
approved