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.

A064895 Binary concentration of n. Replace 2^e_k with 2^(e_k/g(n)) in binary expansion of n, where g(n) = GCD of exponents e_k = A064894(n).

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 10, 11, 12, 13, 14, 15, 2, 3, 18, 19, 6, 7, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 2, 3, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 2, 3, 66, 67, 10, 11, 70, 71, 6, 7, 74, 75
Offset: 0

Views

Author

Marc LeBrun, Oct 11 2001

Keywords

Examples

			577 = 2^0 + 2^6 + 2^9, GCD(0,6,9) = 3, a(577) = 2^(0/3)+2^(6/3)+2^(9/3) = 13.
		

Crossrefs

Programs

  • Mathematica
    A064895[n_] := With[{e = Flatten[Position[Reverse[IntegerDigits[n, 2]], 1]] - 1}, Total[2^(e/Max[Apply[GCD, e], 1])]];
    Array[A064895, 100, 0] (* Paolo Xausa, Feb 13 2024 *)
  • PARI
    a(n) = { my (b=vector(hammingweight(n))); for (i=1, #b, n-=2^b[i]=valuation(n,2);); b /= max(1, gcd(b)); sum(i=1, #b, 2^b[i]); } \\ Rémy Sigrist, Oct 16 2022

Formula

If n = 2^(g(n)e0) + 2^(g(n)e1) +... then a(n) = 2^e0 + 2^e1 +...