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.

A379775 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.

Original entry on oeis.org

2, 3, 5, 17, 11, 7, 13, 97, 193, 769, 29, 19, 37, 73, 577, 1153, 461, 307, 613, 31, 61, 241, 113, 449, 23, 89, 59, 233, 929, 619, 1237, 2473, 43, 337, 673, 269, 179, 211, 421, 41, 107, 71, 47, 67, 53, 139, 277, 79, 157, 313, 1249, 227, 151, 601, 1201, 4801
Offset: 1

Views

Author

Robert C. Lyons, Jan 02 2025

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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)