login
A284904
The number of integers k less than 2^n whose decimal representation of their reciprocals has an odd period.
0
0, 0, 1, 2, 5, 10, 20, 40, 80, 150, 280, 522, 965, 1802, 3393, 6426, 12197, 23236, 44419, 85116, 163543, 314837, 607440, 1174134, 2273619, 4409116, 8561931, 16646790, 32404446, 63145533, 123173667
OFFSET
0,4
COMMENTS
The number of terms in A284601 less than 2^n.
FORMULA
log(a(n)) is approximately 0.33 + 0.727*n - 0.643*sqrt(n).
EXAMPLE
a(5)=10 because the reciprocals of {3, 6, 9, 12, 15, 18, 24, 27, 30, 31} all have an odd period, i.e., {1, 1, 1, 1, 1, 1, 1, 3, 1, 15}, respectively.
MATHEMATICA
f[n_] := Mod[ Length[ RealDigits[1/n][[1, -1]]], 2]; s = 0; k = 1; lst = {}; Do[ While[k < 2^n, s += f@k; k++]; AppendTo[lst, s], {n, 0, 18}] (* or *)
g[n_] := Mod[ MultiplicativeOrder[10, FixedPoint[ Quotient[#, GCD[#, 10]] &, n]], 2]; h[n_] := Length@ Most@ Flatten@ Table[2^i*5^j, {i, 0, n}, {j, 0, Log[5, 2^(n -i)]}]; s = 0; k = 1; lst = {}; Do[ While[k < 2^n, s += g@k; k++]; AppendTo[lst, s - h[n]], {n, 0, 30}]
CROSSREFS
Cf. A284601.
Sequence in context: A327287 A296122 A293324 * A084215 A024810 A049938
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Apr 05 2017
STATUS
approved