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 17 primes.
- The first 10^3 terms include the first 131 primes.
- The first 10^4 terms include the first 808 primes.
- The first 10^5 terms include the first 4397 primes.
- The first 10^6 terms include the first 35801 primes.
- The first 10^7 terms include the first 253682 primes.
Conjecture: this sequence is a permutation of the primes.
If we start with 1 instead of 2 we get A379727. - N. J. A. Sloane, Dec 31 2024
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
a(6) is 19 because the prime factors of c=2*a(5)+1 (i.e., 95) are 5 and 19, and 5 already appears in the sequence as a(2).
a(9) is 31 because the prime factors of c=2*a(8)+1 (i.e., 15) are 3 and 5 which already appear in the sequence as a(7) and a(2). The next value of c (i.e., 2*c+1) is 31, which is prime and does not already appear in the sequence.
MATHEMATICA
c[_] := True; j = 2; c[2] = False;
{j}~Join~Reap[Do[m = 2*j + 1;
While[Set[k, SelectFirst[FactorInteger[m][[All, 1]], c] ];
!IntegerQ[k],
m = 2*m + 1];
c[k] = False; j = Sow[k], {120}] ][[-1, 1]] (* Michael De Vlieger, Dec 29 2024 *)
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, Dec 28 2024
STATUS
approved
