OFFSET
1,1
COMMENTS
The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
- The first 10^2 terms include the first 28 primes.
- The first 10^3 terms include the first 92 primes.
- The first 10^4 terms include the first 710 primes.
- The first 10^5 terms include the first 4848 primes.
- The first 10^6 terms include the first 29442 primes.
- The first 10^7 terms include the first 260324 primes.
Conjecture: this sequence is a permutation of the primes.
LINKS
Robert C. Lyons, Table of n, a(n) for n = 1..10000
EXAMPLE
a(6) is 7 because the prime factors of c=2*a(5)-1 (i.e., 21) are 3 and 7, and 3 already appears in the sequence as a(2).
a(8) is 97 because the only prime factor of c=2*a(7)-1 (i.e., 25) is 5 which already appears in the sequence as a(3). The next value of c (i.e., 2*c-1) is 49; its only prime factor is 7 which already appears in the sequence as a(6). The next value of c (i.e., 2*c-1) is 97, which is prime and does not already appear in the sequence.
PROG
(Python)
from sympy import primefactors
seq = [2]
seq_set = set(seq)
max_seq_len=100
while len(seq) <= max_seq_len:
c = seq[-1]
done = False
while not done:
c = 2*c-1
factors = primefactors(c)
for factor in factors:
if factor not in seq_set:
seq.append(factor)
seq_set.add(factor)
done = True
break
print(seq)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert C. Lyons, Jan 02 2025
STATUS
approved