A382963 Prime index gaps between consecutive full reptend primes.
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
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.
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
Comments