cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A284904 The number of integers k less than 2^n whose decimal representation of their reciprocals has an odd period.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Apr 05 2017

Keywords

Comments

The number of terms in A284601 less than 2^n.

Examples

			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.
		

Crossrefs

Cf. A284601.

Programs

  • 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}]

Formula

log(a(n)) is approximately 0.33 + 0.727*n - 0.643*sqrt(n).