OFFSET
0,2
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
FORMULA
a(n)=sum(k=0,n,wt(k)!) where wt(k) is the Hamming weight of k.
MATHEMATICA
FoldList[Plus, 0!, Table[(Plus @@ IntegerDigits[n, 2])!, {n, 1, 70}]] (* From Olivier Gérard, Mar 23 2011 *)
Accumulate[DigitCount[Range[0, 70], 2, 1]!] (* Harvey P. Dale, Jun 26 2013 *)
PROG
(PARI)
bitcount(x)=
{ /* Return Hamming weight of x */
local(p); p = 0;
while ( x, p+=bitand(x, 1); x>>=1; );
return( p );
}
N=65; /* that many terms */
f=vector(N, n, bitcount(n-1)!); /* factorials of Hamming weights */
s=vector(N); s[1]=f[1]; /* for cumulative sums */
for (n=2, N, s[n]=s[n-1]+f[n]); /* sum up */
s /* show terms */ /* Joerg Arndt, Mar 20 2011 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, Mar 20 2011
STATUS
approved