OFFSET
0,3
FORMULA
EXAMPLE
a(4) = (2^4 - 1) * 4 = 15 * 4 = 60.
a(5) = (2^5 - 1) * 1 = 31 * 1 = 31.
MAPLE
a := n -> `if`(n=0, 0, (2^n-1)*2^padic[ordp](n, 2)): seq(a(n), n=0..33);
MATHEMATICA
a[0] := 0; a[n_] := (2^n - 1) 2^IntegerExponent[n, 2]; Array[a, 34, 0]
PROG
(PARI) a(n) = if (n, (2^n - 1)*2^valuation(n, 2), 0); \\ Michel Marcus, Jul 21 2020
(Python)
def A335956(n): return ((1<<n)-1)*(n&-n) # Chai Wah Wu, Mar 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jul 21 2020
STATUS
approved