login
A382963
Prime index gaps between consecutive full reptend primes.
0
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,1
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.
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).
EXAMPLE
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.
PROG
(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
CROSSREFS
Partial differences of A060257.
Sequence in context: A385198 A081060 A255811 * A131268 A109221 A369227
KEYWORD
nonn,easy
AUTHOR
Kyle Wyonch, Apr 10 2025
STATUS
approved