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.

This page as a plain text file.
%I A007138 M2888 #97 Apr 15 2025 08:28:51
%S A007138 3,11,37,101,41,7,239,73,333667,9091,21649,9901,53,909091,31,17,
%T A007138 2071723,19,1111111111111111111,3541,43,23,11111111111111111111111,
%U A007138 99990001,21401,859,757,29,3191,211,2791,353,67,103,71,999999000001,2028119,909090909090909091
%N A007138 Smallest primitive factor of 10^n - 1. Also smallest prime p such that 1/p has repeating decimal expansion of period n.
%C A007138 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
%C A007138 Also the least prime number p such that the multiplicative order of 10 modulo p is n. - _Robert G. Wilson v_, Dec 09 2013
%C A007138 n always divides p-1. - _Jon Perry_, Nov 02 2014
%D A007138 Ajima Naonobu (aka Ajima Chokuyen), Fujin Isshũ (Periods of Decimal Fractions).
%D A007138 J. Brillhart et al., Factorizations of b^n +/- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
%D A007138 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A007138 Max Alekseyev, <a href="/A007138/b007138.txt">Table of n, a(n) for n = 1..438</a> (terms 1..364 from T. D. Noe)
%H A007138 J. Brillhart et al., <a href="http://dx.doi.org/10.1090/conm/022">Factorizations of b^n +- 1</a>, Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 3rd edition, 2002.
%H A007138 Torbjörn Granlund, <a href="https://gmplib.org/~tege/fac10m.txt">Factors of 10^n-1</a>.
%H A007138 Makoto Kamada, <a href="https://stdkmd.net/nrr/repunit">Factorizations of 11...11 (Repunit)</a>.
%H A007138 Yousuke Koide, <a href="https://repunit-koide.jimdofree.com/">Factors of Repunit Numbers</a>.
%H A007138 David Eugene Smith and Yoshio Mikami, <a href="http://archive.org/details/historyofjapanes00smitiala">A History of Japanese Mathematics</a>, Open Court, Chicago, 1914; chapter X.
%H A007138 S. S. Wagstaff, Jr., <a href="http://www.cerias.purdue.edu/homes/ssw/cun/index.html">The Cunningham Project</a>
%H A007138 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DecimalExpansion.html">Decimal Expansion</a>
%H A007138 Wikipedia, <a href="http://en.wikipedia.org/wiki/Repeating_decimal">Repeating decimals</a>
%H A007138 Robert G. Wilson v and Max Alekseyev, <a href="/A007138/a007138_1.txt">Smallest primitive factor of 10^n -1, or 0 if not yet found, for a(n) and n=1..10000</a>
%H A007138 <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>
%e A007138 a(3) = 37 since 1/37 = 0.027027... has period 3, and 37 is the smallest such prime (in fact, the only one).
%p A007138 S:= {}:
%p A007138 for n from 1 to 60 do
%p A007138   F:= numtheory:-factorset(10^n-1) minus S;
%p A007138   A[n]:= min(F);
%p A007138   S:= S union F;
%p A007138 od:
%p A007138 seq(A[n],n=1..60); # _Robert Israel_, Nov 10 2014
%t A007138 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 *)
%Y A007138 First column of A046107.
%Y A007138 Cf. A001913.
%Y A007138 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).
%K A007138 nonn,base
%O A007138 1,1
%A A007138 _N. J. A. Sloane_, _Mira Bernstein_, _Robert G. Wilson v_, _Jud McCranie_
%E A007138 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