cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

1, 17, 186, 12234, 605714, 30143621, 865062888, 374978871766, 92420578210888, 22764626902276757, 4227156427366610576, 1076625258046594762034, 196829039855755478065982, 34737980525681450161565604, 3519580168264415862502129296, 8186117385516870986118141242073
Offset: 1

Views

Author

Tamas Sandor Nagy, Jan 20 2024

Keywords

Examples

			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
		

Crossrefs

Programs

  • 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

Extensions

More terms from Andrew Howroyd, Jan 20 2024