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.

A381957 If n = Sum 2^e(k), then a(n) = Sum 2^a(e(k)), with a(0) = 1.

Original entry on oeis.org

1, 2, 4, 6, 16, 18, 20, 22, 64, 66, 68, 70, 80, 82, 84, 86, 65536, 65538, 65540, 65542, 65552, 65554, 65556, 65558, 65600, 65602, 65604, 65606, 65616, 65618, 65620, 65622, 262144, 262146, 262148, 262150, 262160, 262162, 262164, 262166, 262208, 262210, 262212, 262214, 262224, 262226
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 11 2025

Keywords

Comments

Replace 2^k in the binary representation of n with 2^a(k).

Examples

			25 = 2^4 + 2^3 + 2^0, hence a(25) = 2^a(4) + 2^a(3) + 2^a(0) = 2^16 + 2^6 + 2^1 = 65602.
		

Crossrefs

Programs

  • Mathematica
    e[n_] := -1 + Position[Reverse[IntegerDigits[n, 2]], 1] // Flatten; a[0] = 1; a[n_] := a[n] = Total[2^a /@ e[n]]; Array[a, 50, 0] (* Amiram Eldar, Mar 11 2025 *)
  • PARI
    a(n) = if (n==0, 1, my(v=Vecrev(binary(n))); sum(k=1, #v, if (v[k], 2^a(k-1)))); \\ Michel Marcus, Mar 11 2025

Formula

G.f.: 1 + (1/(1 - x)) * Sum_{k>=0} 2^a(k) * x^(2^k) / (1 + x^(2^k)).