OFFSET
1,2
FORMULA
a(n) = sum_{i=1..n} sum_{d|i} (2^d - 1) * mu(i/d)
EXAMPLE
1/6 = 0.0010101... has repeating bits of period 2, but is not counted because it has a preperiodic part (i.e., the repetition doesn't start immediately after the binary point). Also, 0 = 0.000... is counted and considered to have period 1.
a(1) = |{0 = 0.(0)...}| = 1
a(2) = |{0 = 0.(0)..., 1/3 = 0.(01)..., 2/3 = 0.(10)...}| = 3
MATHEMATICA
Table[Sum[Plus@@((2^Divisors[i]-1)MoebiusMu[i/Divisors[i]]), {i, 1, n}], {n, 1, 30 }]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Brad Chalfan (brad(AT)chalfan.net), May 29, 2006
STATUS
approved