|
|
A079073
|
|
Sum of numbers < n having in binary representation the same number of 1's as n.
|
|
3
|
|
|
0, 0, 1, 0, 3, 3, 8, 0, 7, 14, 23, 7, 33, 18, 31, 0, 15, 45, 62, 45, 80, 64, 85, 15, 100, 107, 132, 38, 158, 65, 94, 0, 31, 124, 157, 186, 191, 221, 258, 124, 227, 296, 337, 163, 379, 206, 251, 31, 267, 423, 472, 297, 522, 348, 401, 78, 574, 455, 512, 133, 570, 192, 253, 0, 63
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
LINKS
|
|
|
MAPLE
|
f:= n-> add(i, i=convert(n, base, 2)):
b:= proc(n) b(n):= b(n-1)+n*x^f(n) end: b(-1):=0:
a:= n-> coeff(b(n-1), x, f(n)):
|
|
MATHEMATICA
|
a[n_] := Module[{dc = DigitCount[n, 2, 1]}, Select[Range[n-1], DigitCount[#, 2, 1] == dc&] // Total];
|
|
PROG
|
(PARI) a(n) = my(s=hammingweight(n)); sum(k=1, n-1, if (s==hammingweight(k), k)); \\ Michel Marcus, Nov 07 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|