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.

User: Kyle Wyonch

Kyle Wyonch's wiki page.

Kyle Wyonch has authored 1 sequences.

A382963 Prime index gaps between consecutive full reptend primes.

Original entry on oeis.org

3, 1, 1, 1, 5, 2, 1, 7, 4, 1, 2, 3, 4, 2, 1, 2, 4, 2, 1, 4, 1, 1, 8, 3, 5, 2, 1, 1, 4, 3, 5, 4, 1, 1, 1, 1, 3, 5, 1, 2, 6, 4, 2, 6, 1, 2, 3, 9, 1, 1, 5, 2, 4, 5, 1, 2, 2, 1, 1, 5, 1, 2, 3, 2, 1, 1, 1, 2, 1, 1, 5, 2, 1, 2, 3, 1, 1, 4, 5, 1, 1, 1, 4, 2, 2, 5, 1
Offset: 1

Author

Kyle Wyonch, Apr 10 2025

Keywords

Comments

This sequence gives the number of primes between consecutive full reptend primes, where a full reptend prime is a prime p for which 10 is a primitive root modulo p.

Examples

			The full reptend primes begin 7 (index 4), 17 (index 7), 19 (index 8), 23 (index 9). Then:
a(1) = 7 - 4 = 3,
a(2) = 8 - 7 = 1,
a(3) = 9 - 8 = 1.
		

Crossrefs

Partial differences of A060257.

Programs

  • Python
    from sympy import isprime, primerange, primepi
    def is_full_reptend_prime(p):
      if not isprime(p): return False
      k, mod = 1, 10 % p
      while mod != 1:
        mod = (mod * 10) % p
        k += 1
        if k >= p: return False
      return k == p - 1
    primes = list(primerange(2, 1000))
    reptends = [p for p in primes if is_full_reptend_prime(p)]
    gaps = [primepi(reptends[i+1]) - primepi(reptends[i]) for i in range(len(reptends)-1)]
    print(gaps)
    
  • Python
    from sympy import nextprime, n_order
    def A382963_gen(): # generator of terms
        p, c = 7, 0
        while True:
            p, c = nextprime(p), c+1
            if n_order(10, p)==p-1:
                yield c
                c = 0
    A382963_list = list(islice(A382963_gen(),87)) # Chai Wah Wu, Apr 10 2025

Formula

a(n) = pi(r(n+1)) - pi(r(n)), where r(n) is the n-th full reptend prime and pi(p) gives the prime index of p.
a(n) = A060257(n+1) - A060257(n).