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.

A007138 Smallest primitive factor of 10^n - 1. Also smallest prime p such that 1/p has repeating decimal expansion of period n.

Original entry on oeis.org

3, 11, 37, 101, 41, 7, 239, 73, 333667, 9091, 21649, 9901, 53, 909091, 31, 17, 2071723, 19, 1111111111111111111, 3541, 43, 23, 11111111111111111111111, 99990001, 21401, 859, 757, 29, 3191, 211, 2791, 353, 67, 103, 71, 999999000001, 2028119, 909090909090909091
Offset: 1

Views

Author

Keywords

Comments

In the 18th century, the Japanese mathematician Ajima Naonobu (a.k.a. Ajima Chokuyen) gave the first 16 terms (Smith and Mikami, p. 199). - Jonathan Sondow, May 25 2013
Also the least prime number p such that the multiplicative order of 10 modulo p is n. - Robert G. Wilson v, Dec 09 2013
n always divides p-1. - Jon Perry, Nov 02 2014

Examples

			a(3) = 37 since 1/37 = 0.027027... has period 3, and 37 is the smallest such prime (in fact, the only one).
		

References

  • Ajima Naonobu (aka Ajima Chokuyen), Fujin Isshũ (Periods of Decimal Fractions).
  • J. Brillhart et al., Factorizations of b^n +/- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First column of A046107.
Cf. A001913.
Cf. A112927 (base 2), A143663 (base 3), A112092 (base 4), A143665 (base 5), A379639 (base 6), A379640 (base 7), A379641 (base 8), A379642 (base 9), A007138 (base 10), A379644 (base 11), A252170 (base 12).

Programs

  • Maple
    S:= {}:
    for n from 1 to 60 do
      F:= numtheory:-factorset(10^n-1) minus S;
      A[n]:= min(F);
      S:= S union F;
    od:
    seq(A[n],n=1..60); # Robert Israel, Nov 10 2014
  • Mathematica
    s={}; Reap[Scan[(x=Complement[FactorInteger[10^#-1][[All,1]],s]; Sow[Min[x]]; s=Union[s,x])&,Range@60]][[2,1]] (* Shenghui Yang, Apr 15 2025 *)

Extensions

b-file truncated to 364 terms as a(365) was wrong and is currently unknown (pointed by Eric Chen), and a-file revised by Max Alekseyev, Apr 26 2022