A079072 Sum of numbers < n having in binary representation the same number of 0's as n.
0, 0, 0, 1, 0, 2, 7, 4, 0, 4, 13, 13, 23, 24, 37, 11, 0, 8, 25, 35, 43, 54, 75, 51, 63, 97, 122, 74, 148, 101, 130, 26, 0, 16, 49, 87, 83, 122, 159, 176, 119, 197, 238, 215, 280, 258, 303, 160, 159, 324, 373, 349, 423, 400, 453, 207, 475, 507, 564, 262, 622, 321, 382, 57, 0
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..16383
Programs
-
Maple
f:= n-> add(1-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)): seq(a(n), n=0..150); # Alois P. Heinz, Feb 08 2018
-
Mathematica
snbr[n_]:=Module[{dc=DigitCount[n,2,0]},Total[Select[Range[n-1], DigitCount[ #,2,0]==dc&]]]; Array[snbr,70] (* Harvey P. Dale, May 03 2012 *)