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 21 results. Next

A380531 a(n) is the multiplicative order of -4 modulo prime(n); a(1) = 0 for completion.

Original entry on oeis.org

0, 2, 1, 6, 10, 3, 4, 18, 22, 7, 10, 9, 5, 14, 46, 13, 58, 15, 66, 70, 18, 78, 82, 22, 24, 25, 102, 106, 9, 7, 14, 130, 17, 138, 37, 30, 13, 162, 166, 43, 178, 45, 190, 48, 49, 198, 210, 74, 226, 19, 58, 238, 12, 50, 8, 262, 67, 270, 23, 70
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Comments

a(n) divides (p-1)/4 if p = prime(n) == 1 (mod 4), since (-4)^((p-1)/4) == (+-1+-i)^(p-1) == 1 (mod p), where i^2 == -1 (mod p).

Crossrefs

Cf. A105876 (primes having primitive root -4).
Cf. bases -2..-10: A337878 (if first term 1), A380482, this sequence, A380532, A380533, A380540, A380541, A380542, A385222.

Programs

  • Mathematica
    A380531[n_] := If[n == 1, 0, MultiplicativeOrder[-4, Prime[n]]];
    Array[A380531, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-4}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

A380532 a(n) is the multiplicative order of -5 modulo prime(n); a(3) = 0 for completion.

Original entry on oeis.org

1, 1, 0, 3, 10, 4, 16, 18, 11, 7, 6, 36, 20, 21, 23, 52, 58, 15, 11, 10, 72, 78, 41, 44, 96, 50, 51, 53, 54, 112, 21, 130, 136, 138, 74, 150, 156, 27, 83, 172, 178, 30, 38, 192, 196, 66, 70, 111, 113, 57, 232, 238, 40, 50, 256, 131, 134, 54, 276, 140
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

Cf. A105877 (primes having primitive root -5).
Cf. bases -2..-10: A337878 (if first term 1), A380482, A380531, this sequence, A380533, A380540, A380541, A380542, A385222.

Programs

  • Mathematica
    A380532[n_] := If[n == 3, 0, MultiplicativeOrder[-5, Prime[n]]];
    Array[A380532, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-5}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

A380533 a(n) is the multiplicative order of -6 modulo prime(n); a(1) = a(2) = 0 for completion.

Original entry on oeis.org

0, 0, 2, 1, 5, 12, 16, 18, 22, 7, 3, 4, 40, 6, 46, 13, 29, 60, 66, 70, 36, 39, 41, 88, 12, 5, 51, 53, 108, 112, 63, 65, 136, 46, 74, 75, 156, 54, 166, 86, 89, 60, 38, 96, 7, 99, 210, 111, 113, 228, 232, 34, 20, 125, 256, 262, 67, 135, 276, 56
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

Cf. A105878 (primes having primitive root -6).
Cf. bases -2..-10: A337878 (if first term 1), A380482, A380531, A380532, this sequence, A380540, A380541, A380542, A385222.

Programs

  • Mathematica
    A380533[n_] := If[n < 3, 0, MultiplicativeOrder[-6, Prime[n]]];
    Array[A380533, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-6}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

A380540 a(n) is the multiplicative order of -7 modulo prime(n); a(4) = 0 for completion.

Original entry on oeis.org

1, 2, 4, 0, 5, 12, 16, 6, 11, 14, 30, 18, 40, 3, 46, 13, 58, 60, 33, 35, 24, 39, 82, 88, 96, 100, 102, 53, 54, 7, 63, 130, 68, 138, 37, 75, 52, 81, 166, 172, 89, 12, 5, 24, 49, 198, 105, 74, 226, 228, 116, 119, 240, 250, 256, 131, 268, 270, 69, 20
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

Cf. A105879 (primes having primitive root -7).
Cf. bases -2..-10: A337878 (if first term 1), A380482, A380531, A380532, A380533, this sequence, A380541, A380542, A385222.

Programs

  • Mathematica
    A380540[n_] := If[n == 4, 0, MultiplicativeOrder[-7, Prime[n]]];
    Array[A380540, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-7}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

A380541 a(n) is the multiplicative order of -8 modulo prime(n); a(1) = 0 for completion.

Original entry on oeis.org

0, 1, 4, 2, 5, 4, 8, 3, 22, 28, 10, 12, 20, 7, 46, 52, 29, 20, 11, 70, 6, 26, 41, 22, 16, 100, 34, 53, 12, 28, 14, 65, 68, 23, 148, 10, 52, 27, 166, 172, 89, 60, 190, 32, 196, 66, 35, 74, 113, 76, 58, 238, 8, 25, 16, 262, 268, 90, 92, 35
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

Cf. A105880 (primes having primitive root -8).
Cf. bases -2..-10: A337878 (if first term 1), A380482, A380531, A380532, A380533, A380540, this sequence, A380542, A385222.

Programs

  • Mathematica
    A380541[n_] := If[n == 1, 0, MultiplicativeOrder[-8, Prime[n]]];
    Array[A380541, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-8}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

Formula

a(n) = ord(-2,p)/gcd(ord(-2,p),3) for p != 2, where p = prime(n), and ord(a,m) is the multiplicative order of a modulo m. Note that ord(-2,p) = A337878(n) for n > 2.

A380542 a(n) is the multiplicative order of -9 modulo prime(n); a(2) = 0 for completion.

Original entry on oeis.org

1, 0, 1, 6, 10, 6, 8, 18, 22, 7, 30, 18, 4, 42, 46, 13, 58, 10, 22, 70, 3, 78, 82, 44, 24, 25, 34, 106, 54, 56, 126, 130, 68, 138, 37, 50, 78, 162, 166, 43, 178, 90, 190, 8, 49, 198, 210, 222, 226, 114, 116, 238, 60, 250, 128, 262, 67, 30, 138, 140
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

Cf. A105881 (primes having primitive root -9).
Cf. bases -2..-10: A337878 (if first term 1), A380482, A380531, A380532, A380533, A380540, A380541, this sequence, A385222.

Programs

  • Mathematica
    A380542[n_] := If[n == 2, 0, MultiplicativeOrder[-9, Prime[n]]];
    Array[A380542, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-9}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

A385222 a(n) is the multiplicative order of -10 modulo prime(n); a(1) = a(3) = 0 for completion.

Original entry on oeis.org

0, 2, 0, 3, 1, 3, 16, 9, 11, 28, 30, 6, 10, 42, 23, 26, 29, 60, 66, 70, 8, 26, 82, 44, 96, 4, 17, 106, 108, 112, 21, 65, 8, 23, 148, 150, 39, 162, 83, 86, 89, 180, 190, 192, 49, 198, 15, 111, 226, 228, 232, 14, 15, 25, 256, 131, 268, 10, 138, 28
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

Cf. A007348 (primes having primitive root -10).
Cf. bases -2..-10: A337878 (if first term 1), A380482, A380531, A380532, A380533, A380540, A380541, A380542, this sequence.

Programs

  • Mathematica
    A385222[n_] := If[n == 1 || n == 3, 0, MultiplicativeOrder[-10, Prime[n]]];
    Array[A385222, 100] (* Paolo Xausa, Jun 29 2025 *)
  • PARI
    a(n,{k=-10}) = my(p = prime(n)); if(k%p==0, 0, znorder(Mod(k,p)))

A372801 Order of 16 modulo the n-th prime: least k such that prime(n) divides 16^k-1.

Original entry on oeis.org

1, 1, 3, 5, 3, 2, 9, 11, 7, 5, 9, 5, 7, 23, 13, 29, 15, 33, 35, 9, 39, 41, 11, 12, 25, 51, 53, 9, 7, 7, 65, 17, 69, 37, 15, 13, 81, 83, 43, 89, 45, 95, 24, 49, 99, 105, 37, 113, 19, 29, 119, 6, 25, 4, 131, 67, 135, 23, 35, 47, 73, 51, 155, 39, 79, 15, 21, 173, 87, 22, 179
Offset: 2

Views

Author

Jianing Song, May 13 2024

Keywords

Comments

a(n) is the period of the expansion of 1/prime(n) in hexadecimal.

Crossrefs

Cf. A302141 (order of 16 mod 2n+1).

Programs

  • PARI
    a(n) = znorder(Mod(16, prime(n))).

Formula

a(n) = A014664(n)/gcd(4, A014664(n)) = A082654(n)/gcd(2, A082654(n)).
a(n) <= (prime(n) - 1)/2.

A364867 Primes p such that the multiplicative order of 9 modulo p is (p-1)/2.

Original entry on oeis.org

5, 7, 11, 17, 19, 23, 29, 31, 43, 47, 53, 59, 71, 79, 83, 89, 101, 107, 113, 127, 131, 137, 139, 149, 163, 167, 173, 179, 191, 197, 199, 211, 223, 227, 233, 239, 251, 257, 263, 269, 281, 283, 293, 311, 317, 331, 347, 353, 359, 379, 383, 389, 401, 419, 443, 449, 461, 463, 467, 479, 487
Offset: 1

Views

Author

Jianing Song, Aug 11 2023

Keywords

Comments

Primes p such that the multiplicative order of 9 modulo p is of the maximum possible value.
Primes p such that 3 or -3 (or both) is a primitive root modulo p. Proof of equivalence: let ord(a,k) be the multiplicative order of a modulo p. if ord(3,p) = p-1, then clearly ord(9,p) = (p-1)/2. If ord(-3,p) = p-1, then we also have ord(9,p) = (p-1)/2. Conversely, suppose that ord(9,p) = (p-1)/2, then ord(3,p) = p-1 or (p-1)/2, and ord(-3,p) = p-1 or (p-1)/2. If ord(3,p) = ord(-3,p) = (p-1)/2, then we have that (p-1)/2 is odd and (-1)^((p-1)/2) == 1 (mod p), a contradiction.
A prime p is a term if and only if one of the two following conditions holds: (a) 3 is a primitive root modulo p; (b) p == 3 (mod 4), and the multiplicative order of 3 modulo p is (p-1)/2 (in this case, we have p == 11 (mod 12) since 3 is a quadratic residue modulo p).
A prime p is a term if and only if one of the two following conditions holds: (a) -3 is a primitive root modulo p; (b) p == 3 (mod 4), and the multiplicative order of -3 modulo p is (p-1)/2 (in this case, we have p == 7 (mod 12) since -3 is a quadratic residue modulo p).
No terms are congruent to 1 modulo 12, since otherwise we would have 9^((p-1)/4) = (+-3)^((p-1)/2) == 1 (mod p). - Jianing Song, May 14 2024

Examples

			7 is a term since the multiplicative order of 9 modulo 7 is 3 = (7-1)/2.
		

Crossrefs

Union of A019334 and A105875.
A105881 is the subsequence of terms congruent to 3 modulo 4.
Cf. A211245 (order of 9 mod n-th prime), A216371.

Programs

  • Mathematica
    okQ[p_] := MultiplicativeOrder[9, p] == (p - 1)/2;
    Select[Prime[Range[100]], okQ] (* Jean-François Alcover, Nov 24 2024 *)
  • PARI
    isA364867(p) = isprime(p) && (p!=3) && znorder(Mod(9, p)) == (p-1)/2
    
  • Python
    from sympy import n_order, nextprime
    from itertools import islice
    def A364867_gen(startvalue=4): # generator of terms >= startvalue
        p = max(startvalue-1,3)
        while (p:=nextprime(p)):
            if n_order(9,p) == p-1>>1:
                yield p
    A364867_list = list(islice(A364867_gen(),20)) # Chai Wah Wu, Aug 11 2023

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)))
Previous Showing 11-20 of 21 results. Next