login
A379652
a(1) = 2. For n > 1, a(n) = smallest prime factor of c=2*a(n-1)+1 that is not in {a(1), ..., a(n-1)}; if all prime factors of c are in {a(1), ..., a(n-1)}, then we try the next value of c, which is 2*c+1; and so on.
8
2, 5, 11, 23, 47, 19, 3, 7, 31, 127, 17, 71, 13, 37, 151, 101, 29, 59, 239, 479, 137, 1103, 2207, 883, 2357, 41, 83, 167, 67, 271, 181, 727, 97, 1567, 6271, 113, 227, 911, 1823, 521, 149, 599, 109, 73, 197, 79, 53, 107, 43, 563, 347, 139, 373, 997, 307, 1231
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
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