login
A369332
a(n) is the sum of numbers whose binary forms can be constructed using some or all of the binary digits of 1..n.
1
1, 17, 186, 12234, 605714, 30143621, 865062888, 374978871766, 92420578210888, 22764626902276757, 4227156427366610576, 1076625258046594762034, 196829039855755478065982, 34737980525681450161565604, 3519580168264415862502129296, 8186117385516870986118141242073
OFFSET
1,2
LINKS
EXAMPLE
For a(3) = 186, the binary forms of n = 1, 2 and 3 are 1, 10 and 11. These together contain four 1's and one 0. The possible combinations to construct binary numbers of these are below with their equivalent decimal values:
1 1
10 2
11 3
101 5
110 6
111 7
1011 11
1101 13
1110 14
1111 15
10111 23
11011 27
11101 29
11110 30
---
Total: 186
PROG
(PARI) a(n)={my(w=0, b=0); for(i=1, n, w+=hammingweight(i); b+=logint(i, 2)+1); sum(j=0, w-1, sum(k=0, b-w, my(t=j+k); if(t, binomial(t, j)*(2^t + j*(2^t-1)/t), 1) ))} \\ Andrew Howroyd, Jan 20 2024
CROSSREFS
Sequence in context: A270497 A025958 A199674 * A022741 A225966 A057614
KEYWORD
nonn,base
AUTHOR
Tamas Sandor Nagy, Jan 20 2024
EXTENSIONS
More terms from Andrew Howroyd, Jan 20 2024
STATUS
approved