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.

A298043 If n = Sum_{i=1..h} 2^b_i with b_1 > ... > b_h >= 0, then a(n) = Sum_{i=1..h} i * 2^b_i.

Original entry on oeis.org

0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20, 23, 24, 27, 30, 34, 32, 35, 38, 42, 44, 48, 52, 57, 32, 34, 36, 39, 40, 43, 46, 50, 48, 51, 54, 58, 60, 64, 68, 73, 64, 67, 70, 74, 76, 80, 84, 89, 88, 92, 96, 101, 104, 109, 114, 120, 64, 66
Offset: 0

Views

Author

Rémy Sigrist, Jan 11 2018

Keywords

Comments

This sequence is similar to A298011.

Examples

			For n = 42:
  42 = 32 + 8 + 2,
  hence a(42) = 1*32 + 2*8 + 3*2 = 54.
		

Crossrefs

Programs

  • PARI
    a(n) = my (b=binary(n), z=0); for (i=1, #b, if (b[i], b[i] = z++)); return (fromdigits(b,2))

Formula

a(n) = Sum_{k = 0..A000120(n)-1} A053645^k(n) for any n > 0 (where A053645^k denotes the k-th iterate of A053645).
a(n) >= n with equality iff n = 0 or n = 2^k for some k >= 0.
a(2 * n) = 2 * a(n).
a(2^n - 1) = A000295(n + 1).
a(2 ^ i + n) = a(n) + 2 ^ i + n for 2 ^ i > n. - David A. Corneth, Jan 14 2018