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.

Previous Showing 11-20 of 27 results. Next

A003060 Smallest number with reciprocal of period length n in decimal (base 10).

Original entry on oeis.org

1, 3, 11, 27, 101, 41, 7, 239, 73, 81, 451, 21649, 707, 53, 2629, 31, 17, 2071723, 19, 1111111111111111111, 3541, 43, 23, 11111111111111111111111, 511, 21401, 583, 243, 29, 3191, 211, 2791, 353, 67, 103, 71, 1919, 2028119, 909090909090909091
Offset: 0

Views

Author

Keywords

Comments

For n > 0, a(n) is the least divisor d > 1 of 10^n - 1 such that the multiplicative order of 10 mod d is n. For prime n > 3, a(n) = A007138(n). - T. D. Noe, Aug 07 2007
For n > 1, a(n) is the smallest positive d such that d divides 10^n - 1 and does not divide any of 10^k - 1 for 0 < k < n. - Maciej Ireneusz Wilczynski, Sep 06 2012, corrected by M. F. Hasler, Jun 28 2022. (For n = 1, d = 1 divides 10^n - 1 and does not divide any 10^k - 1 with 0 < k < n, but a(1) = 3 > 1.)

References

  • J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • "Cycle lengths of reciprocals", Popular Computing (Calabasas, CA), Vol. 1 (No. 4, Jul 1973), pp. 12-14.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Smallest primitive divisors of b^n-1: A212953 (b=2), A218356 (b=3), A218357 (b=5), A218358 (b=7), this sequence (b=10), A218359 (b=11), A218360 (b=13), A218361 (b=17), A218362 (b=19), A218363 (b=23), A218364 (b=29).

Programs

  • Mathematica
    a[n_] := First[ Select[ Divisors[10^n - 1], MultiplicativeOrder[10, #] == n &, 1]]; a[0] = 1; a[1] = 3; Table[a[n], {n, 0, 38}] (* Jean-François Alcover, Jul 13 2012, after T. D. Noe *)
  • PARI
    apply( {A003060(n)=!fordiv(10^n-!!n, d, d>1 && znorder(Mod(10,d))==n && return(d))}, [0..50]) \\ M. F. Hasler, Jun 28 2022

Extensions

Comment corrected by T. D. Noe, Apr 15 2010
More terms from T. D. Noe, Apr 15 2010
b-file truncated at uncertain term a(439) by Max Alekseyev, Apr 30 2022

A072982 Primes p for which the period of 1/p is a power of 2.

Original entry on oeis.org

3, 11, 17, 73, 101, 137, 257, 353, 449, 641, 1409, 10753, 15361, 19841, 65537, 69857, 453377, 976193, 1514497, 5767169, 5882353, 6187457, 8253953, 8257537, 70254593, 167772161, 175636481, 302078977, 458924033, 639631361, 1265011073
Offset: 1

Views

Author

Benoit Cloitre, Jul 26 2002

Keywords

Comments

All Fermat primes > 5 (A019434) are in the sequence, since it can be shown that the period of 1/(2^(2^n)+1) is 2^(2^n) whenever 2^(2^n)+1 is prime. - Benoit Cloitre, Jun 13 2007
Take all the terms from row 2^k of triangle in A046107 for k >= 0 and sort to arrive at this sequence. - Ray Chandler, Nov 04 2011
Additional terms, but not necessarily the next in sequence: 13462517317633 has period 1048576 = 2^20; 46179488366593 has period 2199023255552 = 2^41; 101702694862849 has period 8388608 = 2^23; 171523813933057 has period 4398046511104 = 2^42; 505775348776961 has period 2199023255552 = 2^41; 834427406578561 has period 64 = 2^6 - Ray Chandler, Nov 09 2011
Furthermore (excluding the initial term 3) this sequence is also the ascending sequence of primes dividing 10^(2^k)+1 for some nonnegative integer k. For a prime dividing 10^(2^k)+1, the period of 1/p is 2^(k+1). Thus for the prime p = 558711876337536212257947750090161313464308422534640474631571587847325442162307811\
65223702155223678309562822667655169, a factor of 10^(2^7)+1, the period of 1/p is only 2^8. This large prime then also belongs to the sequence. - Christopher J. Smyth, Mar 13 2014
For any m, every term that is not a factor of 10^(2^k)-1 for some k < m is congruent to 1 (mod 2^m). Thus all terms except 3, 11, 17, 73, 101, 137, 353, 449, 69857, 976193, 5882353, 6187457 are congruent to 1 (mod 128). - Robert Israel, Jun 17 2016
Additional terms listed earlier confirmed as next terms in sequence. - Arkadiusz Wesolowski, Jun 17 2016

Examples

			15361 has a period of 256 = 2^8, hence 15361 is in the sequence.
		

Crossrefs

Cf. A197224 (power of 2 which is the period of the decimal 1/a(n)).

Programs

  • Maple
    filter:= proc(p) local k;
      if not isprime(p) then return false fi;
      k:=igcd(p-1,2^ilog2(p));
      evalb(10 &^ k mod p = 1)
    end proc:
    r:= select(`<=`,`union`(seq(numtheory:-factorset(10^(2^k)-1),k=1..6)),10^9):
    b:= select(filter, {seq(i,i=129..10^9,128)}):
    sort(convert(r union b, list)); # Robert Israel, Jun 17 2016
  • Mathematica
    Do[ If[ IntegerQ[ Log[2, Length[ RealDigits[ 1/Prime[n]] [[1, 1]]]]], Print[ Prime[n]]], {n, 1, 47500}] (* Robert G. Wilson v, May 09 2007 *)
    pmax = 10^10; p = 1; While[p < pmax,p = NextPrime[p];If[ IntegerQ[Log[2, MultiplicativeOrder[10, p] ] ], Print[ p];];]; (* Ray Chandler, May 14 2007 *)
  • PARI
    select( {is_A072982(p)=if(p>5, 1<M. F. Hasler, Nov 18 2024
    
  • Python
    from itertools import count, islice
    from sympy import prime, n_order
    def A072982_gen(): return (p for p in (prime(n) for n in count(2)) if p != 5 and bin(n_order(10,p))[2:].rstrip('0') == '1')
    A072982_list = list(islice(A072982_gen(),10)) # Chai Wah Wu, Feb 07 2022
    
  • Python
    from sympy import primerange, n_order
    A072982_upto = lambda N=1e5: [p for p in primerange(3, N) if p != 5 and n_order(10, p).bit_count() == 1] # or (...) to get a generator. - M. F. Hasler, Nov 19 2024

Extensions

Edited by Robert G. Wilson v, Aug 20 2002
a(18) from Ray Chandler, May 02 2007
a(19) from Robert G. Wilson v, May 09 2007
a(20)-a(32) from Ray Chandler, May 14 2007
Deleted an unsatisfactory PARI program. - N. J. A. Sloane, Nov 19 2024

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)), ", "); ); }

A379644 Smallest primitive prime factor of 11^n-1.

Original entry on oeis.org

2, 3, 7, 61, 3221, 37, 43, 7321, 1772893, 13421, 15797, 13, 1093, 1623931, 195019441, 17, 50544702849929377, 590077, 6115909044841454629, 212601841, 1723, 23, 829, 10657, 3001, 53, 5559917315850179173, 29, 523, 31, 50159, 51329, 661, 71707, 211, 3138426605161
Offset: 1

Views

Author

Sean A. Irvine, Dec 28 2024

Keywords

Comments

Also, smallest prime p such that 1/p has undecimal 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. A274910.

Programs

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

A066364 Prime divisors of solutions to 10^n == 1 (mod n).

Original entry on oeis.org

3, 37, 163, 757, 1999, 5477, 8803, 9397, 13627, 15649, 36187, 40879, 62597, 106277, 147853, 161839, 215893, 231643, 281683, 295759, 313471, 333667, 338293, 478243, 490573, 607837, 647357, 743933, 988643, 1014877, 1056241, 1168711, 1353173, 1390757, 1487867, 1519591, 1627523, 1835083, 1912969, 2028119, 2029759, 2064529
Offset: 1

Views

Author

Vladeta Jovovic, Dec 21 2001

Keywords

Examples

			10^27-1 = 3^5*37*757*333667*440334654777631 is a solution to the congruence.
		

Crossrefs

Programs

  • Mathematica
    fQ[p_] := Block[{fi = First@# & /@ FactorInteger[ MultiplicativeOrder[ 10, p]]}, Union[ MemberQ[ lst, #] & /@ fi] == {True}]; k = 4; lst = {3}; While[k < 180000, If[ p = Prime@ k; fQ@ p, AppendTo[ lst, p]; Print@ p]; k++]; lst (* Robert G. Wilson v, Nov 30 2013 *)
  • PARI
    S=Set([3]); forprime(p=7,10^6, v=factorint(znorder(Mod(10,p)))[,1]; if(length(setintersect(S,Set(v)))==length(v), S=setunion(S,[p])) ); print(vecsort(eval(S))) \\ Max Alekseyev, Nov 16 2005

Formula

A prime p is a term iff all prime divisors of ord_p(10) are terms, where ord_p(10) is the order of 10 modulo p. - Max Alekseyev, Nov 16 2005

Extensions

Edited by Max Alekseyev, Nov 16 2005
Edited by Hans Havermann, Jul 11 2014

A061075 Greatest prime number p(n) with decimal fraction period of length n.

Original entry on oeis.org

3, 11, 37, 101, 271, 13, 4649, 137, 333667, 9091, 513239, 9901, 265371653, 909091, 2906161, 5882353, 5363222357, 52579, 1111111111111111111, 27961, 10838689, 8779, 11111111111111111111111, 99990001, 182521213001, 1058313049, 440334654777631, 121499449, 77843839397
Offset: 1

Views

Author

Heiner Muller-Merbach (hmm(AT)sozwi.uni-kl.de), May 29 2001

Keywords

Examples

			1/271 = 0.0036900369, period of n=5 for p(5)=271.
		

Crossrefs

Last terms in rows of A046107.

Programs

  • Mathematica
    a[n_] := Cyclotomic[n, 10] // FactorInteger // Last // First; Table[a[n], {n, 1, 26}] (* Jean-François Alcover, Aug 05 2013, after Pari *)
  • PARI
    a(n) = my(p); if(n<1, 0, p=factor(polcyclo(n,10))[,1]; p[#p])

Formula

a(n) = A006530(A019328(n)). - Ray Chandler, May 10 2017

Extensions

Terms to a(322) in b-file from Ray Chandler, Apr 28 2017
a(323)-a(352) in b-file from Max Alekseyev, Apr 26 2022

A112505 Number of primitive prime factors of 10^n-1.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 3, 1, 2, 2, 2, 2, 1, 2, 3, 3, 1, 1, 3, 2, 2, 3, 5, 3, 3, 5, 2, 3, 3, 1, 3, 1, 1, 2, 4, 3, 4, 3, 2, 4, 2, 1, 2, 3, 4, 2, 4, 2, 4, 2, 3, 2, 2, 3, 7, 1, 5, 4, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 4, 4, 6, 2, 5, 2, 3, 2, 3, 3, 3, 2, 5, 3, 7, 3, 1, 3, 5, 4, 3, 2, 4, 4
Offset: 1

Views

Author

T. D. Noe, Sep 08 2005

Keywords

Comments

Also the number of primes whose reciprocal is a repeating decimal of length n. The number of numbers in each row of table A046107.
By Zsigmondy's theorem, a(n) >= 1. When a(n)=1, the corresponding prime is called a unique prime (see A007498, A040017 and A051627).

Crossrefs

Cf. A007138 (smallest primitive prime factor of 10^n-1), A102347 (number of distinct prime factors of 10^n-1), A046107.

Programs

  • Mathematica
    pp={}; Table[f=Transpose[FactorInteger[10^n-1]][[1]]; p=Complement[f, pp]; pp=Union[pp, p]; Length[p], {n, 66}]

Extensions

Terms to a(276) in b-file from T. D. Noe, Jun 01 2010
a(277)-a(322) in b-file from Ray Chandler, May 01 2017
a(323)-a(352) in b-file from Max Alekseyev, Apr 28 2022
Previous Showing 11-20 of 27 results. Next