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.

Showing 1-10 of 12 results. Next

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

A112927 a(n) is the least prime such that the multiplicative order of 2 mod a(n) equals n, or a(n)=1 if no such prime exists.

Original entry on oeis.org

1, 3, 7, 5, 31, 1, 127, 17, 73, 11, 23, 13, 8191, 43, 151, 257, 131071, 19, 524287, 41, 337, 683, 47, 241, 601, 2731, 262657, 29, 233, 331, 2147483647, 65537, 599479, 43691, 71, 37, 223, 174763, 79, 61681, 13367, 5419, 431, 397, 631, 2796203, 2351, 97, 4432676798593, 251, 103, 53, 6361, 87211
Offset: 1

Views

Author

Vladimir Shevelev, Aug 25 2008

Keywords

Comments

If a(n) differs from 1, then a(n) is the minimal prime divisor of A064078(n);
a(n)=n+1 iff n+1 is prime from A001122; a(n)=2n+1 iff 2n+1 is prime from A115591.
If a(n) > 1 then a(n) is the index where n occurs first in A014664. - M. F. Hasler, Feb 21 2016
Bang's theorem (special case of Zsigmondy's theorem, see links): a(n)>1 for all n>6. - Jeppe Stig Nielsen, Aug 31 2020

Crossrefs

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

  • PARI
    A112927(n,f=factor(2^n-1)[,1])=!for(i=1,#f,znorder(Mod(2,f[i]))==n&&return(f[i])) \\ Use the optional 2nd arg to give a list of pseudoprimes to try when factoring of 2^n-1 is too slow. You may try factor(2^n-1,0)[,1]. - M. F. Hasler, Feb 21 2016

A143665 a(n) is the least prime such that the multiplicative order of 5 mod a(n) equals n.

Original entry on oeis.org

2, 3, 31, 13, 11, 7, 19531, 313, 19, 521, 12207031, 601, 305175781, 29, 181, 17, 409, 5167, 191, 41, 379, 23, 8971, 390001, 101, 5227, 109, 234750601, 59, 61, 1861, 2593, 199, 3061, 211, 37, 149, 761, 79, 241, 2238236249, 43, 1644512641, 89, 1171, 47
Offset: 1

Views

Author

Vladimir Shevelev, Aug 28 2008

Keywords

Crossrefs

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

  • Mathematica
    p = 2; t = Table[0, {100}]; While[p < 3000000001, a = MultiplicativeOrder[5, p]; If[0 < a < 101 && t[[a]] == 0, t[[a]] = p]; p = NextPrime@ p]; t (* Robert G. Wilson v, Oct 13 2014 *)

Extensions

a(23)-a(40) from Robert G. Wilson v, Oct 13 2014
a(41)-a(46) from Robert G. Wilson v, Oct 15 2014

A143663 a(n) is the least prime such that the multiplicative order of 3 mod a(n) equals n, or a(n)=1 if no such prime exists.

Original entry on oeis.org

2, 1, 13, 5, 11, 7, 1093, 41, 757, 61, 23, 73, 797161, 547, 4561, 17, 1871, 19, 1597, 1181, 368089, 67, 47, 6481, 8951, 398581, 109, 29, 59, 31, 683, 21523361, 2413941289, 103, 71, 530713, 13097927, 2851, 313, 42521761, 83, 43, 431, 5501, 181, 23535794707
Offset: 1

Views

Author

Vladimir Shevelev, Aug 28 2008

Keywords

Comments

If a(n) differs from 1, then a(n) is the minimal prime divisor of A064079(n).

Crossrefs

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
    a:= proc(n) local f,p;
    f:= numtheory:-factorset(3^n - 1);
    for  p in f do
       if numtheory:-order(3,p) = n then return p fi
    od:
    1
    end proc:
    seq(a(n),n=1..100); # Robert Israel, Oct 13 2014
  • Mathematica
    p = 2; t = Table[0, {100}]; While[p < 100000001, a = MultiplicativeOrder[3, p]; If[0 < a < 101 && t[[a]] == 0, t[[a]] = p; Print[{a, p}]];  p = NextPrime@ p]; t (* Robert G. Wilson v, Oct 13 2014 *)

Extensions

More terms from Robert G. Wilson v, Dec 11 2013

A366707 Number of distinct prime divisors of 12^n - 1.

Original entry on oeis.org

1, 2, 2, 4, 2, 5, 3, 6, 4, 4, 3, 8, 3, 6, 6, 9, 3, 9, 2, 7, 5, 5, 4, 12, 4, 7, 6, 10, 5, 13, 5, 11, 7, 6, 9, 14, 3, 6, 7, 13, 4, 13, 5, 11, 12, 8, 3, 18, 5, 10, 6, 12, 7, 16, 7, 13, 7, 8, 4, 18, 4, 8, 8, 13, 8, 16, 5, 10, 7, 14, 4, 21, 3, 7, 11, 11, 10, 17, 4
Offset: 1

Views

Author

Sean A. Irvine, Oct 17 2023

Keywords

Crossrefs

Programs

  • PARI
    for(n = 1, 100, print1(omega(12^n - 1), ", "))

Formula

a(n) = omega(12^n-1) = A001221(A024140(n)).

A112092 a(n) is the least prime such that the multiplicative order of 4 mod a(n) equals n.

Original entry on oeis.org

3, 5, 7, 17, 11, 13, 43, 257, 19, 41, 23, 241, 2731, 29, 151, 65537, 43691, 37, 174763, 61681, 337, 397, 47, 97, 251, 53, 87211, 15790321, 59, 61, 715827883, 641, 67, 137, 71, 433, 223, 229, 79, 4278255361, 83, 1429, 431, 353, 631, 277, 283, 193, 4363953127297
Offset: 1

Views

Author

Vladimir Shevelev, Aug 28 2008

Keywords

Comments

a(n) is the minimal prime divisor of A064080(n).

Crossrefs

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

  • Mathematica
    a[n_] := Module[{f = FactorInteger[4^n - 1][[;; , 1]]}, Do[p = f[[k]]; If[ MultiplicativeOrder[4, p] == n, Break[] ], {k, 1, Length[f]}]; p]; Array[a, 100] (* Amiram Eldar, Jan 27 2019 *)
  • PARI
    a(n) = {my(p = 3); while (znorder(Mod(4, p)) != n, p = nextprime(p+1)); p;} \\ Michel Marcus, Feb 08 2016

Extensions

a(29)-a(30) from Michel Marcus, Feb 08 2016
More term from Amiram Eldar, Jan 27 2019

A379640 Smallest primitive prime factor of 7^n-1.

Original entry on oeis.org

2, 1, 19, 5, 2801, 43, 29, 1201, 37, 11, 1123, 13, 16148168401, 113, 31, 17, 14009, 117307, 419, 281, 11898664849, 23, 47, 73, 2551, 53, 109, 13564461457, 59, 6568801, 311, 353, 3631, 29078814248401, 2127431041, 13841169553, 223, 351121, 486643, 41, 83, 51031
Offset: 1

Views

Author

Sean A. Irvine, Dec 28 2024

Keywords

Comments

Also, smallest prime p such that 1/p has septimal period n.

Crossrefs

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).
Cf. A074249.

Programs

  • PARI
    listap(nn) = {prf = []; for (n=1, nn, vp = (factor(7^n-1)[, 1])~; f = setminus(Set(vp), Set(prf)); prf = concat(prf, f); print1(vecmin(Vec(f)), ", "); ); }

A379641 Smallest primitive prime factor of 8^n-1.

Original entry on oeis.org

7, 3, 73, 5, 31, 19, 127, 17, 262657, 11, 23, 37, 79, 43, 631, 97, 103, 87211, 32377, 41, 92737, 67, 47, 433, 601, 2731, 2593, 29, 233, 18837001, 2147483647, 193, 199, 307, 71, 246241, 223, 571, 937, 61681, 13367, 77158673929, 431, 397, 271, 139, 2351, 577
Offset: 1

Views

Author

Sean A. Irvine, Dec 28 2024

Keywords

Comments

Also, smallest prime p such that 1/p has octal period n.

Crossrefs

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).
Cf. A274908.

Programs

  • PARI
    listap(nn) = {prf = []; for (n=1, nn, vp = (factor(8^n-1)[, 1])~; f = setminus(Set(vp), Set(prf)); prf = concat(prf, f); print1(vecmin(Vec(f)), ", "); ); }

A379642 Smallest primitive prime factor of 9^n-1.

Original entry on oeis.org

2, 5, 7, 41, 11, 73, 547, 17, 19, 1181, 23, 6481, 398581, 29, 31, 21523361, 103, 530713, 1597, 42521761, 43, 5501, 47, 97, 151, 53, 109, 430697, 59, 47763361, 683, 926510094425921, 25411, 956353, 71, 282429005041, 18427, 5301533, 79, 14401, 83, 2857, 431, 89
Offset: 1

Views

Author

Sean A. Irvine, Dec 28 2024

Keywords

Comments

Also, smallest prime p such that 1/p has nonary period n.

Crossrefs

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).
Cf. A274909.

Programs

  • PARI
    listap(nn) = {prf = []; for (n=1, nn, vp = (factor(9^n-1)[, 1])~; f = setminus(Set(vp), Set(prf)); prf = concat(prf, f); print1(vecmin(Vec(f)), ", "); ); }

A379639 Smallest primitive prime factor of 6^n-1.

Original entry on oeis.org

5, 7, 43, 37, 311, 31, 55987, 1297, 19, 11, 23, 13, 3433, 29, 1171, 17, 239, 46441, 191, 241, 1822428931, 51828151, 47, 1678321, 18198701, 53, 163, 421, 7369130657357778596659, 1950271, 5333, 353, 67, 190537, 71, 73, 149, 1787, 3143401, 41, 8648131, 2527867231
Offset: 1

Views

Author

Sean A. Irvine, Dec 28 2024

Keywords

Comments

Also, smallest prime p such that 1/p has senary period n.

Crossrefs

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).
Cf. A274907.

Programs

  • PARI
    listap(nn) = {prf = []; for (n=1, nn, vp = (factor(6^n-1)[, 1])~; f = setminus(Set(vp), Set(prf)); prf = concat(prf, f); print1(vecmin(Vec(f)), ", "); ); }
Showing 1-10 of 12 results. Next