OFFSET
1,1
FORMULA
a(n) = 2^n * sum_{j=1..n} sum_{d|j} (2^d - 1) * mu(j/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) = |{ 0/1 = 0.(0)..., 1/3 = 0.(01)..., 2/3 = 0.(10)..., 1/2 = 0.1(0)..., 1/6 = 0.0(01)..., 5/6 = 0.1(10)..., 1/4 = 0.01(0)..., 3/4 = 0.11(0)..., 1/12 = 0.00(01)..., 5/12 = 0.01(10)..., 7/12 = 0.10(01)..., 11/12 = 0.11(10)...}| = 12
MATHEMATICA
Table[2^n Sum[Plus@@((2^Divisors[j]-1)MoebiusMu[j/Divisors[j]]), {j, 1, n}], {n, 1, 22}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Brad Chalfan (brad(AT)chalfan.net), May 28, 2006
STATUS
approved