A378959 Sum, in base 10, of the permutations of the digits of n, written in base 2.
0, 1, 3, 3, 7, 14, 14, 7, 15, 45, 45, 45, 45, 45, 45, 15, 31, 124, 124, 186, 124, 186, 186, 124, 124, 186, 186, 124, 186, 124, 124, 31, 63, 315, 315, 630, 315, 630, 630, 630, 315, 630, 630, 630, 630, 630, 630, 315, 315, 630, 630, 630, 630, 630, 630, 315, 630
Offset: 0
Examples
a(5) = 14 because 5 in base 2 is 101 and the permutations of the digits are 101, 110, 011 that correspond to 5, 6, 3 and 5 + 6 + 3 = 14.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..16384
Programs
-
Maple
a:= proc(n) local k, l; l:= convert(n, base, 2); k:= nops(l); binomial(k-1, add(i, i=l)-1)*(2^k-1) end: seq(a(n), n=0..56); # Alois P. Heinz, Dec 12 2024
-
Mathematica
A378959[n_] := (2^# - 1)*Binomial[# - 1, DigitCount[n, 2, 0]] & [BitLength[n]]; Array[A378959, 100, 0] (* Paolo Xausa, Jan 29 2025 *)
Comments