OFFSET
1,2
FORMULA
a(n) = 2^(n-1) * sum_{d|n} (2^d - 1) * mu(n/d)
EXAMPLE
The binary expansion of 7/24 = 0.010(01)... has 3 preperiodic bits (to the right of the binary point) followed by 2 periodic (i.e., repeating) bits, while 1/2 = 0.1(0)... has one bit of each type. The preperiodic and periodic parts are both chosen to be as short as possible.
a(2) = |{1/12 = 0.00(01)..., 5/12 = 0.01(10)..., 7/12 = 0.10(01)..., 11/12 = 0.11(10)...}| = 4
MATHEMATICA
Table[2^(n-1)(Plus@@((2^Divisors[n]-1)MoebiusMu[n/Divisors[n]])), {n, 1, 23} ]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Brad Chalfan (brad(AT)chalfan.net), May 28, 2006
STATUS
approved