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.

A062117 Order of 3 mod n-th prime.

Original entry on oeis.org

1, 0, 4, 6, 5, 3, 16, 18, 11, 28, 30, 18, 8, 42, 23, 52, 29, 10, 22, 35, 12, 78, 41, 88, 48, 100, 34, 53, 27, 112, 126, 65, 136, 138, 148, 50, 78, 162, 83, 172, 89, 45, 95, 16, 196, 198, 210, 222, 113, 57, 232, 119, 120, 125, 256, 131, 268, 30, 69, 280, 282, 292, 34
Offset: 1

Views

Author

Olivier Gérard, Jun 06 2001

Keywords

Examples

			The 3rd prime is 5 and mod 5, 3^4 = 1, so a(3) = 4.
		

Crossrefs

Cf. A019334 (full reptend primes in base 3).

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);;
    List([1..Length(A000040)],n->OrderMod(3,A000040[n])); # Muniru A Asiru, Feb 07 2019
    
  • Mathematica
    Table[With[{p=Prime[n]},If[p==3,0,MultiplicativeOrder[3,p]]],{n,63}] (* Ray Chandler, Apr 06 2016 *)
  • PARI
    a(n,{base=3}) = my(p=prime(n)); if(base%p, znorder(Mod(base,p)), 0) \\ Jianing Song, May 13 2024
  • Python
    from sympy import n_order, prime
    def A062117(n): return n_order(3,prime(n)) if n != 2 else 0 # Chai Wah Wu, Nov 10 2023