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

A167799 Numbers with primitive root -3.

Original entry on oeis.org

2, 5, 10, 11, 17, 22, 23, 25, 29, 34, 46, 47, 50, 53, 58, 59, 71, 83, 89, 94, 101, 106, 107, 113, 118, 125, 131, 137, 142, 149, 166, 167, 173, 178, 179, 191, 197, 202, 214, 226, 227, 233, 239, 250, 251, 257, 262, 263, 269, 274, 281, 289, 293, 298, 311, 317, 334
Offset: 1

Views

Author

T. D. Noe, Nov 12 2009

Keywords

Crossrefs

Cf. A105875 (primes with primitive root -3)

Programs

  • Mathematica
    pr=-3; Select[Range[2,2000], MultiplicativeOrder[pr,# ] == EulerPhi[ # ] &]
  • PARI
    is(n)=if(n%3==0, return(0)); my(p=eulerphi(n)); znorder(Mod(-3, n), p)==p \\ Charles R Greathouse IV, Jan 04 2025

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

Original entry on oeis.org

1, 0, 4, 3, 10, 6, 16, 9, 22, 28, 15, 9, 8, 21, 46, 52, 58, 5, 11, 70, 12, 39, 82, 88, 48, 100, 17, 106, 54, 112, 63, 130, 136, 69, 148, 25, 39, 81, 166, 172, 178, 90, 190, 16, 196, 99, 105, 111, 226, 114, 232, 238, 120, 250, 256, 262, 268, 15, 138, 280
Offset: 1

Views

Author

Jianing Song, Jun 27 2025

Keywords

Crossrefs

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

Programs

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

A105874 Primes for which -2 is a primitive root.

Original entry on oeis.org

5, 7, 13, 23, 29, 37, 47, 53, 61, 71, 79, 101, 103, 149, 167, 173, 181, 191, 197, 199, 239, 263, 269, 271, 293, 311, 317, 349, 359, 367, 373, 383, 389, 421, 461, 463, 479, 487, 503, 509, 541, 557, 599, 607, 613, 647, 653, 661, 677, 701, 709, 719, 743, 751, 757, 773, 797
Offset: 1

Views

Author

N. J. A. Sloane, Apr 24 2005

Keywords

Comments

Also primes for which (p-1)/2 (==-1/2 mod p) is a primitive root. [Joerg Arndt, Jun 27 2011]

Crossrefs

Programs

  • Maple
    with(numtheory); f:=proc(n) local t1,i,p; t1:=[]; for i from 1 to 500 do p:=ithprime(i); if order(n,p) = p-1 then t1:=[op(t1),p]; fi; od; t1; end; f(-2);
  • Mathematica
    pr=-2; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &] (* N. J. A. Sloane, Jun 01 2010 *)
    a[p_,q_]:=Sum[2 Cos[2^n Pi/((2 q+1) (2 p+1))], {n,1,2 q p}];
    Select[Range[400], Reduce[a[#, 1] == 1, Integers] &];
    2 % + 1 (* Gerry Martens, Apr 28 2015 *)
  • PARI
    forprime(p=3,10^4,if(p-1==znorder(Mod(-2,p)),print1(p", "))); /* Joerg Arndt, Jun 27 2011 */
    
  • Python
    from sympy import n_order, nextprime
    from itertools import islice
    def A105874_gen(startvalue=3): # generator of terms >= startvalue
        p = max(startvalue-1,2)
        while (p:=nextprime(p)):
            if n_order(-2,p) == p-1:
                yield p
    A105874_list = list(islice(A105874_gen(),20)) # Chai Wah Wu, Aug 11 2023

Formula

Let a(p,q)=sum(n=1,2*p*q,2*cos(2^n*Pi/((2*q+1)*(2*p+1)))). Then 2*p+1 is a prime belonging to this sequence when a(p,1)==1. - Gerry Martens, May 21 2015

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
Showing 1-4 of 4 results.