Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #20 Jan 02 2025 09:34:56
%S 1,3,7,5,11,23,47,19,13,37,151,101,29,59,17,71,41,83,167,67,271,181,
%T 727,97,1567,6271,113,227,911,1823,521,149,599,109,73,197,79,53,107,
%U 43,563,347,139,31,127,89,179,359,719,1439,2879,443,887,7103,14207,5683,421,281,1289,2579,607,1621,499,1999,5333,10667,251,503,733,163,131,263,211,3391,13567,7753,1723,383,307,1231,821,173,293
%N a(1) = 1. 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.
%C If we start with a(1) = 2, we get A379652.
%H Robert C. Lyons, <a href="/A379727/b379727.txt">Table of n, a(n) for n = 1..10000</a>
%t c[_] := True; j = 1; c[1] = False;
%t {j}~Join~Reap[Do[
%t m = 2*j + 1;
%t While[
%t Set[k, SelectFirst[FactorInteger[m][[All, 1]], c]]; !
%t IntegerQ[k], m = 2*m + 1]; c[k] = False;
%t j = Sow[k], {120}] ][[-1, 1]] (* _Michael De Vlieger_, Dec 31 2024 *)
%o (Python)
%o from sympy import primefactors
%o seq = [1]
%o seq_set = set(seq)
%o max_seq_len=100
%o while len(seq) <= max_seq_len:
%o c = seq[-1]
%o done = False
%o while not done:
%o c = 2*c+1
%o factors = primefactors(c)
%o for factor in factors:
%o if factor not in seq_set:
%o seq.append(factor)
%o seq_set.add(factor)
%o done = True
%o break
%o print(seq) # _Robert C. Lyons_, Jan 01 2025
%Y Cf. A379652, A379649.
%K nonn
%O 1,2
%A _N. J. A. Sloane_, Dec 31 2024