A099245 Numerator of relative frequency of number of ones in the binary representation of n.
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
Examples
Fractions begin with 0, 1, 1/2, 1, 1/3, 2/3, 2/3, 1, 1/4, 1/2, 1/2, 3/4, ...
Links
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 *)
Comments