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.

A094593 a(n) = (p-1)/x, where p = prime(n) and x = ord(3,p), the smallest positive integer such that 3^x == 1 mod p.

Original entry on oeis.org

1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 5, 1, 2, 1, 2, 6, 3, 2, 6, 1, 2, 1, 2, 1, 3, 2, 4, 1, 1, 2, 1, 1, 1, 3, 2, 1, 2, 1, 2, 4, 2, 12, 1, 1, 1, 1, 2, 4, 1, 2, 2, 2, 1, 2, 1, 9, 4, 1, 1, 1, 9, 2, 8, 1, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 2, 4, 10, 16, 3, 2, 1, 2
Offset: 3

Views

Author

Benoit Cloitre, Jun 06 2004

Keywords

Crossrefs

Cf. A001917.

Programs

  • PARI
    a(n)=(prime(n)-1)/if(n<0,0,k=1;while((3^k-1)%prime(n)>0,k++);k)
    
  • Python
    from sympy import prime, n_order
    def A094593(n):
        p = prime(n)
        return 1 if n == 3 else (p-1)//n_order(3,p) # Chai Wah Wu, Jan 15 2020

Formula

a(n) = (A000040(n)-1)/A062117(n).