cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A379652 #35 Jan 02 2025 14:23:28
%S A379652 2,5,11,23,47,19,3,7,31,127,17,71,13,37,151,101,29,59,239,479,137,
%T A379652 1103,2207,883,2357,41,83,167,67,271,181,727,97,1567,6271,113,227,911,
%U A379652 1823,521,149,599,109,73,197,79,53,107,43,563,347,139,373,997,307,1231
%N 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.
%C A379652 The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
%C A379652 - The first 10^2 terms include the first 17 primes.
%C A379652 - The first 10^3 terms include the first 131 primes.
%C A379652 - The first 10^4 terms include the first 808 primes.
%C A379652 - The first 10^5 terms include the first 4397 primes.
%C A379652 - The first 10^6 terms include the first 35801 primes.
%C A379652 - The first 10^7 terms include the first 253682 primes.
%C A379652 Conjecture: this sequence is a permutation of the primes.
%C A379652 If we start with 1 instead of 2 we get A379727. - _N. J. A. Sloane_, Dec 31 2024
%H A379652 Michael De Vlieger, <a href="/A379652/b379652.txt">Table of n, a(n) for n = 1..10000</a>
%e A379652 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).
%e A379652 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.
%t A379652 c[_] := True; j = 2; c[2] = False;
%t A379652 {j}~Join~Reap[Do[m = 2*j + 1;
%t A379652   While[Set[k, SelectFirst[FactorInteger[m][[All, 1]], c] ];
%t A379652     !IntegerQ[k],
%t A379652     m = 2*m + 1];
%t A379652   c[k] = False; j = Sow[k], {120}] ][[-1, 1]] (* _Michael De Vlieger_, Dec 29 2024 *)
%o A379652 (Python)
%o A379652 from sympy import primefactors
%o A379652 seq = [2]
%o A379652 seq_set = set(seq)
%o A379652 max_seq_len=100
%o A379652 while len(seq) <= max_seq_len:
%o A379652     c = seq[-1]
%o A379652     done = False
%o A379652     while not done:
%o A379652         c = 2*c+1
%o A379652         factors = primefactors(c)
%o A379652         for factor in factors:
%o A379652             if factor not in seq_set:
%o A379652                 seq.append(factor)
%o A379652                 seq_set.add(factor)
%o A379652                 done = True
%o A379652                 break
%o A379652 print(seq)
%Y A379652 Cf. A031439, A072268, A131200, A174162, A379648.
%K A379652 nonn
%O A379652 1,1
%A A379652 _Robert C. Lyons_, Dec 28 2024