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-7 of 7 results.

A054471 Smallest prime p having n different cycles in decimal expansions of k/p, k=1..p-1.

Original entry on oeis.org

7, 3, 103, 53, 11, 79, 211, 41, 73, 281, 353, 37, 2393, 449, 3061, 1889, 137, 2467, 16189, 641, 3109, 4973, 11087, 1321, 101, 7151, 7669, 757, 38629, 1231, 49663, 12289, 859, 239, 27581, 9613, 18131, 13757, 33931, 9161, 118901, 6763, 18233
Offset: 1

Views

Author

Robert G. Wilson v, 1994; Antreas P. Hatzipolakis (xpolakis(AT)otenet.gr), May 22 2000

Keywords

Comments

First cyclic number of n-th degree (or n-th order): the reciprocals of these numbers belong to one of n different cycles. Each cycle has (a(n) - 1)/n digits.
From Robert G. Wilson v, Aug 21 2014: (Start)
recursive by indices:
1, 7, 211, 79337, 634776923741, ...
2, 3, 103, 2368589, 785245568161181, ...
4, 53, 135257, 2332901103899, ...
5, 11, 353, 3795457, 693814982285339, ...
6, 79, 26861, 23947548497, ...
8, 41, 118901, 1015118238709, ...
9, 73, 142789, 267291583927, ...
10, 281, 3097183, 66880786504811, ...
12, 37, 18131, 105385168331, ...
13, 2393, 11160953, 7140939250711817, ...
14, 4999, 2148340247, > 10^19,
... .
(End)

References

  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, p. 162.
  • M. Gardner, Mathematical Circus, Cambridge University Press (1996).

Crossrefs

First time n appears in A006556.
Cf. A006883, A097443, A055628, A056157, A056210, A056211, A056212, A056213, A056214, A056215, A056216, A056217, A098680, which are sequences of primes p where the period of the reciprocal is (p-1)/n for n=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.
Cf. A101208, A101209 (similar sequences for base 2 and base 3).

Programs

  • Mathematica
    a[n_Integer] := Block[{m = If[ OddQ@ n, 2n, n]}, p = m +1; While[ !PrimeQ@ p || p != 1 + n*MultiplicativeOrder[10, p], p = p += m]; p]; a[1] = 7; a[4] = 53; Array[f, 50] (* Robert G. Wilson v, Apr 19 2005; revised Aug 20 2014 and Feb 14 2025 *)

Extensions

More terms from David W. Wilson, May 22 2000

A101208 Smallest odd prime p such that n = (p - 1) / ord_p(2).

Original entry on oeis.org

3, 7, 43, 113, 251, 31, 1163, 73, 397, 151, 331, 1753, 4421, 631, 3061, 257, 1429, 127, 6043, 3121, 29611, 1321, 18539, 601, 15451, 14327, 2971, 2857, 72269, 3391, 683, 2593, 17029, 2687, 42701, 11161, 13099, 1103, 71293, 13121, 17467, 2143, 83077, 25609, 5581
Offset: 1

Views

Author

Leigh Ellison (le(AT)maths.gla.ac.uk), Dec 14 2004

Keywords

Comments

First time n appears is given in A001917.
Smallest p (let it be the k-th prime) such that A001917(k) = n, or the smallest prime which has ratio n in base 2.
First cyclic number (in base 2) of n-th degree (or n-th order): the reciprocals of these numbers belong to one of n different cycles. Each cycle has (a(n) - 1)/n digits.
Conjecture: a(n) is defined for all n.
Recursive by indices: (See A054471)
1, 3, 43, 83077, ...
2, 7, 1163, ...
4, 113, 257189, ...
5, 251, 6846277, ...
6, 31, 683, ...
8, 73, 472019, ...
9, 397, 13619483, ...
10, 151, 349717, ...
...
The records for the ratio in base 2 are: 1, 2, 6, 8, 18, 24, 31, 38, 72, 105, 129, 630, 1285, 1542, 2048, ..., the primes are: 3, 7, 31, 73, 127, 601, 683, 1103, 1801, 2731, 5419, 8191, 43691, 61681, 65537, ...
(Updated by Eric Chen, Jun 01 2015)

Crossrefs

Cf. A001122, A115591, A001133, A001134, A001135, A001136, A152307, A152308, A152309, A152310, A152311, which are sequences of primes p where the period of the reciprocal in base 2 is (p-1)/n for n=1 to 11.

Programs

  • Mathematica
    f[n_Integer] := Block[{k = 1, p}, While[p = k*n + 1; ! PrimeQ[p] || p != 1 + n*MultiplicativeOrder[2, p] || p = 2, k++]; p]; Array[f, 128] (* Eric Chen, Jun 01 2015 *)
  • PARI
    a(n) = {p=3; ok = 0; until(ok, if (n == (p-1)/znorder(Mod(2, p)), ok = 1, p = nextprime(p+1));); return (p);} \\ Michel Marcus, Jun 27 2013

A372797 Smallest prime p such that the multiplicative order of 4 modulo p is 2*n, or 0 if no such prime exists.

Original entry on oeis.org

3, 17, 31, 73, 151, 433, 631, 337, 127, 241, 331, 601, 4421, 673, 3061, 257, 1429, 1657, 1103, 3121, 2143, 1321, 18539, 1777, 2351, 37441, 2971, 2857, 3191, 17401, 683, 15809, 17029, 9929, 38431, 1801, 11471, 63689, 49999, 13121, 17467, 21169, 83077, 25609, 5581, 5153, 26227
Offset: 1

Views

Author

Jianing Song, May 13 2024

Keywords

Comments

First prime p such that the expansion of 1/p has period (p-1)/(2*n) in base 4. Also the first prime p such that {k/p : 1 <= k <= p-1} has 2*n different cycles when written out in base 4.
Since ord(a^m,k) = ord(a,k)/gcd(m,ord(a,k)) for gcd(a,k) = 1, we have that (p-1)/ord(4,p) = ((p-1)/ord(2,p)) * gcd(2,ord(2,p)) is always even. Here ord(a,k) is the multiplicative order of a modulo k.

Examples

			In the following examples let () denote the reptend. The prime numbers themselves and the fractions are written out in decimal.
The base-4 expansion of 1/3 is 0.(1), so the reptend has length 1 = (3-1)/2. Also, the base-4 expansions of 1/3 = 0.(1) and 2/3 = 0.(2) have two cycles 1 and 2. 3 is the smallest such prime, so a(1) = 3.
The base-4 expansion of 1/17 is 0.(0033), so the reptend has length 4 = (17-1)/4. Also, the base-4 expansions of 1/17, 2/17, ..., 16/17 have four cycles 0033, 0132, 1023 and 1122. 17 is the smallest such prime, so a(2) = 17.
The base-4 expansion of 1/31 is 0.(00133), so the reptend has length 5 = (31-1)/6. Also, the base-4 expansions of 1/31, 2/31, ..., 30/31 have three cycles 00201, 01203, 02211, 03213, 11223 and 13233. 13 is the smallest such prime, so a(3) = 13.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = For[p = 2, True, p = NextPrime[p], If[MultiplicativeOrder[4, p] == (p-1)/(2n), Return[p]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 24 2024 *)
  • PARI
    a(n,{base=4}) = forprime(p=2, oo, if((base%p) && znorder(Mod(base,p)) == (p-1)/(n * if(issquare(base), 2, 1)), return(p)))

A372798 Smallest prime p such that the multiplicative order of 8 modulo p is n, or 0 if no such prime exists.

Original entry on oeis.org

3, 17, 13, 113, 251, 7, 1163, 89, 109, 431, 1013, 577, 4421, 953, 571, 257, 4523, 127, 15467, 3761, 3109, 7151, 18539, 73, 25301, 14327, 2971, 42953, 72269, 151, 683, 12641, 331, 2687, 42701, 5113, 18797, 1103, 8581, 13121, 172283, 631, 221021, 120737, 3061, 5153, 217517
Offset: 1

Views

Author

Jianing Song, May 13 2024

Keywords

Comments

First prime p such that the expansion of 1/p has period (p-1)/n in base 8. Also the first prime p such that {k/p : 1 <= k <= p-1} has n different cycles when written out in base 8.

Examples

			In the following examples let () denote the reptend. The prime numbers themselves and the fractions are written out in decimal.
The base-8 expansion of 1/3 is 0.(25), so the reptend has length 2 = (3-1)/1. Also, the base-8 expansions of 1/3 = 0.(25) and 2/3 = 0.(52) have only one cycle 25. 3 is the smallest such prime, so a(1) = 3.
The base-8 expansion of 1/17 is 0.(03607417), so the reptend has length 8 = (17-1)/2. Also, the base-8 expansions of 1/17, 2/17, ..., 16/17 have two cycles 03607417 and 13226455. 17 is the smallest such prime, so a(2) = 17.
The base-8 expansion of 1/13 is 0.(0473), so the reptend has length 4 = (13-1)/3. Also, the base-8 expansions of 1/13, 2/13, ..., 12/13 have three cycles 0473, 1166 and 2354. 13 is the smallest such prime, so a(3) = 13.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = For[p = 2, True, p = NextPrime[p], If[MultiplicativeOrder[8, p] == (p-1)/n, Return[p]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 24 2024 *)
  • PARI
    a(n,{base=8}) = forprime(p=2, oo, if((base%p) && znorder(Mod(base,p)) == (p-1)/(n * if(issquare(base), 2, 1)), return(p)))

A372799 Smallest prime p such that the multiplicative order of 9 modulo p is 2*n, or 0 if no such prime exists.

Original entry on oeis.org

5, 13, 67, 313, 41, 61, 883, 433, 271, 2161, 683, 193, 1223, 8317, 2131, 769, 2551, 1621, 8513, 2521, 8779, 4357, 5843, 3889, 7451, 16069, 3079, 19993, 14327, 661, 23747, 95617, 42703, 2857, 15401, 17209, 2887, 7297, 547, 13441, 4019, 757, 41453, 29833, 54631, 31741, 20399
Offset: 1

Views

Author

Jianing Song, May 13 2024

Keywords

Comments

First prime p such that the expansion of 1/p has period (p-1)/(2*n) in base 9. Also the first prime p such that {k/p : 1 <= k <= p-1} has 2*n different cycles when written out in base 9.
Since ord(a^m,k) = ord(a,k)/gcd(m,ord(a,k)) for gcd(a,k) = 1, we have that (p-1)/ord(9,p) = ((p-1)/ord(3,p)) * gcd(2,ord(3,p)) is always even. Here ord(a,k) is the multiplicative order of a modulo k.

Examples

			In the following examples let () denote the reptend. The prime numbers themselves and the fractions are written out in decimal.
The base-9 expansion of 1/5 is 0.(17), so the reptend has length 2 = (5-1)/2. Also, the base-9 expansions of 1/5 = 0.(17), 2/5 = (0.35), 3/5 = 0.(53) and 4/5 = 0.(71) have two cycles 17 and 35. 5 is the smallest such prime, so a(1) = 5.
The base-9 expansion of 1/13 is 0.(062), so the reptend has length 3 = (13-1)/4. Also, the base-9 expansions of 1/13, 2/13, ..., 12/13 have four cycles 062, 134, 268 and 475. 13 is the smallest such prime, so a(2) = 13.
The base-9 expansion of 1/67 is 0.(01178285332), so the reptend has length 11 = (67-1)/6. Also, the base-9 expansions of 1/67, 2/67, ..., 66/67 have six cycles 01178285332, 02367581664, 03556877106, 04746273438, 07224865213 and 08414261545. 67 is the smallest such prime, so a(3) = 67.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = For[p = 2, True, p = NextPrime[p], If[MultiplicativeOrder[9, p] == (p-1)/(2n), Return[p]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 24 2024 *)
  • PARI
    a(n,{base=9}) = forprime(p=2, oo, if((base%p) && znorder(Mod(base,p)) == (p-1)/(n * if(issquare(base), 2, 1)), return(p)))

A372800 Smallest prime p such that the multiplicative order of 16 modulo p is 2*n, or 0 if no such prime exists.

Original entry on oeis.org

3, 5, 31, 17, 151, 109, 631, 113, 127, 1181, 331, 433, 13963, 1709, 3331, 1217, 2687, 397, 1103, 241, 2143, 1013, 18539, 1777, 2351, 4421, 2971, 673, 3191, 3061, 683, 257, 58147, 1429, 38431, 1657, 11471, 22573, 49999, 3121, 17467, 33013, 252583, 1321, 23671, 51797, 26227, 4513
Offset: 1

Views

Author

Jianing Song, May 13 2024

Keywords

Comments

First prime p such that the expansion of 1/p has period (p-1)/(2*n) in base 16. Also the first prime p such that {k/p : 1 <= k <= p-1} has 2*n different cycles when written out in base 16.
Since ord(a^m,k) = ord(a,k)/gcd(m,ord(a,k)) for gcd(a,k) = 1, we have that (p-1)/ord(16,p) = ((p-1)/ord(2,p)) * gcd(4,ord(2,p)) is always even. Here ord(a,k) is the multiplicative order of a modulo k.

Examples

			In the following examples let () denote the reptend. The prime numbers themselves and the fractions are written out in decimal.
The base-16 expansion of 1/3 is 0.(5), so the reptend has length 1 = (3-1)/2. Also, the base-16 expansions of 1/3 = 0.(5) and 2/3 = 0.(A) have two cycles 5 and A. 3 is the smallest such prime, so a(1) = 3.
The base-16 expansion of 1/5 is 0.(3), so the reptend has length 1 = (5-1)/4. Also, the base-16 expansions of 1/5 = 0.(3), 2/5 = (0.6), 3/5 = 0.(9) and 4/5 = 0.(C) have four cycles 3, 6, 9 and A. 5 is the smallest such prime, so a(2) = 5.
The base-16 expansion of 1/31 is 0.(08421), so the reptend has length 5 = (31-1)/6. Also, the base-16 expansions of 1/31, 2/31, ..., 30/31 have six cycles 08421, 18C63, 294A5, 39CE7, 5AD6B and 7BDEF. 31 is the smallest such prime, so a(3) = 31.
		

Crossrefs

Cf. A372801.

Programs

  • Mathematica
    a[n_] := a[n] = For[p = 2, True, p = NextPrime[p], If[MultiplicativeOrder[16, p] == (p-1)/(2n), Return[p]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 24 2024 *)
  • PARI
    a(n,{base=16}) = forprime(p=2, oo, if((base%p) && znorder(Mod(base,p)) == (p-1)/(n * if(issquare(base), 2, 1)), return(p)))

A347772 Square array read by antidiagonals downwards: T(n,k) is the smallest prime p not dividing n such that (p-1) / ord_p(n) = k (n>=2, k>=1), or 0 if no such p exists.

Original entry on oeis.org

3, 7, 2, 43, 11, 0, 113, 67, 3, 2, 251, 13, 0, 11, 11, 31, 41, 17, 13, 19, 2, 1163, 61, 0, 101, 7, 3, 3, 73, 883, 31, 0, 5, 73, 17, 2, 397, 313, 0, 199, 31, 29, 13, 5, 7, 151, 271, 73, 827, 139, 1031, 113, 0, 3, 2, 331, 431, 0, 569, 463, 19, 251, 13, 103, 7, 5, 1753, 5743, 151, 487, 97, 43
Offset: 2

Views

Author

Eric Chen, Sep 14 2021

Keywords

Examples

			Table begins:
  n\k |  1   2    3    4     5    6     7    8    9    10    11    12
  ----+--------------------------------------------------------------
   2  |  3   7   43  113   251   31  1163   73  397   151   331  1753
   3  |  2  11   67   13    41   61   883  313  271   431  5743   193
   4  |  0   3    0   17     0   31     0   73    0   151     0   433
   5  |  2  11   13  101     0  199   827  569  487    31  1453   181
   6  | 11  19    7    5    31  139   463   97   37   101   353   241
   7  |  2   3   73   29  1031   19    43  113  883   311   353  1453
   8  |  3  17   13  113   251    7  1163   89  109   431  1013   577
   9  |  2   5    0   13     0   67     0  313    0    41     0    61
  10  |  7   3  103   53    11   79   211   41   73   281   353    37
  11  |  2   7  193    5   191   19   379  449  199  1301  2531  1549
  12  |  5  23   19   37   271   13    29  193  487    11    89   373
  ...
		

Crossrefs

Row 2: A101208.
Row 3: A101209.
Row 10: A054471.
Column 1: A056619.

Programs

  • PARI
    a(m, n)=forprime(p=2, 2^40, if(gcd(m, p)==1 && znorder(Mod(m, p))==(p-1)/n, return(p)))
    is(m, n)=p=core(m); if(p>1 && p%4==1 && n%p==0 && n%2, return(1)); 0
    A347772(m, n)=if(is(m, n) || (issquare(m) && n%2 && (m%2==0 || n>1)), 0, a(m, n))

Formula

T(n,k) = 0 if n is square, k is odd, n > 1.
T(n,k) = 0 if n is even square, k is odd.
T(n,k) = 0 if (let n' be the squarefree part (A007913) of n) n' == 1 (mod 4), n' > 1, k is divisible by n', k is odd.
T(27,k) = 0 for k == 4 or 8 (mod 12).
T(n,k) == 1 mod k if nonzero.
Showing 1-7 of 7 results.