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.

A006559 Short period primes: the decimal expansion of 1/p has period less than p-1, but greater than zero.

Original entry on oeis.org

3, 11, 13, 31, 37, 41, 43, 53, 67, 71, 73, 79, 83, 89, 101, 103, 107, 127, 137, 139, 151, 157, 163, 173, 191, 197, 199, 211, 227, 239, 241, 251, 271, 277, 281, 283, 293, 307, 311, 317, 331, 347, 349, 353, 359, 373, 397, 401, 409, 421, 431, 439, 443, 449, 457
Offset: 1

Views

Author

Keywords

Comments

Primes 2 and 5 are excluded because 1/2 and 1/5 have no period. Also primes p whose multiplicative order mod p is less than p-1.

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006883.

Programs

  • Mathematica
    Select[Prime[Range[100]], MultiplicativeOrder[10, #] < # - 1 &]
  • PARI
    a(n)=gcd(n,10)==1 && isprime(n) && znorder(Mod(10,n))Charles R Greathouse IV, Mar 15 2014
    
  • Python
    from itertools import islice
    from sympy import nextprime, n_order
    def A006559_gen(startvalue=1): # generator of terms >= startvalue
        p = max(startvalue-1,1)
        while (p:=nextprime(p)):
            if p!=2 and p!=5 and n_order(10,p)A006559_list = list(islice(A006559_gen(),20)) # Chai Wah Wu, Mar 03 2025

Extensions

More terms from James Sellers, Aug 21 2000