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.

A382963 Prime index gaps between consecutive full reptend primes.

This page as a plain text file.
%I A382963 #18 Apr 10 2025 17:05:22
%S A382963 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,
%T A382963 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,
%U A382963 1,1,5,2,1,2,3,1,1,4,5,1,1,1,4,2,2,5,1
%N A382963 Prime index gaps between consecutive full reptend primes.
%C A382963 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.
%F A382963 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.
%F A382963 a(n) = A060257(n+1) - A060257(n).
%e A382963 The full reptend primes begin 7 (index 4), 17 (index 7), 19 (index 8), 23 (index 9). Then:
%e A382963 a(1) = 7 - 4 = 3,
%e A382963 a(2) = 8 - 7 = 1,
%e A382963 a(3) = 9 - 8 = 1.
%o A382963 (Python)
%o A382963 from sympy import isprime, primerange, primepi
%o A382963 def is_full_reptend_prime(p):
%o A382963   if not isprime(p): return False
%o A382963   k, mod = 1, 10 % p
%o A382963   while mod != 1:
%o A382963     mod = (mod * 10) % p
%o A382963     k += 1
%o A382963     if k >= p: return False
%o A382963   return k == p - 1
%o A382963 primes = list(primerange(2, 1000))
%o A382963 reptends = [p for p in primes if is_full_reptend_prime(p)]
%o A382963 gaps = [primepi(reptends[i+1]) - primepi(reptends[i]) for i in range(len(reptends)-1)]
%o A382963 print(gaps)
%o A382963 (Python)
%o A382963 from sympy import nextprime, n_order
%o A382963 def A382963_gen(): # generator of terms
%o A382963     p, c = 7, 0
%o A382963     while True:
%o A382963         p, c = nextprime(p), c+1
%o A382963         if n_order(10, p)==p-1:
%o A382963             yield c
%o A382963             c = 0
%o A382963 A382963_list = list(islice(A382963_gen(),87)) # _Chai Wah Wu_, Apr 10 2025
%Y A382963 Partial differences of A060257.
%Y A382963 Cf. A000040, A000720, A001913.
%K A382963 nonn,easy
%O A382963 1,1
%A A382963 _Kyle Wyonch_, Apr 10 2025