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.

A099245 Numerator of relative frequency of number of ones in the binary representation of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 5, 1, 1, 1, 2, 1, 2, 2, 5, 1, 2, 2, 5, 2, 5, 5, 1, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 08 2004

Keywords

Examples

			Fractions begin with 0, 1, 1/2, 1, 1/3, 2/3, 2/3, 1, 1/4, 1/2, 1/2, 3/4, ...
		

Crossrefs

Cf. A000120, A007088, A070939, A099244, A099246 (denominators).

Programs

  • Haskell
    import Data.Ratio ((%), numerator)
    a099245 n = numerator $ (a000120 n) % (a070939 n)
    -- Reinhard Zumkeller, Oct 10 2013
  • Mathematica
    a[n_] := Numerator[First[#]/Total[#]] & @ DigitCount[n, 2, {1, 0}]; Array[a, 100, 0] (* Amiram Eldar, Apr 05 2025 *)

Formula

a(n)*A070939(n) = A099246(n)*A000120(n).
a(n) = A000120(n)/A099244(n) for n > 0.
a(n) = if n=0 then 0 else A000120(n)/GCD(A070939(n), A000120(n)).