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.

A384698 The first prime number reached by iterating the map, x -> 2*x + 1 if x is even; x - lpf(x) otherwise where lpf(x) is the least prime factor of x, on n >= 2; or -1 if a prime is never reached.

Original entry on oeis.org

2, 3, 13, 5, 13, 7, 17, 13, 37, 11, 41, 13, 29, 41, 61, 17, 37, 19, 41, 37, 613, 23, 613, 41, 53, 613, 109, 29, 61, 31, 829, 61, 1861, 61, 73, 37, 277, 73, 157, 41, 613, 43, 89, 613, 181, 47, 97, 613, 101, 97, 401, 53, 109, 101, 113, 109, 229, 59, 829, 61, 241
Offset: 2

Views

Author

Ya-Ping Lu, Jun 09 2025

Keywords

Comments

Conjecture: a(n) != -1.

Examples

			a(4) = 13 because iterating the map on n = 4 reaches a prime, 13, in three steps: 4 -> 2*4+1=9 -> 9-3=6 -> 2*6+1=13.
		

Crossrefs

Cf. A020639 (lpf), A383777.

Programs

  • Python
    from sympy import isprime, primefactors
    for n in range (2, 63):
        while not isprime(n): n = n - min(primefactors(n)) if n%2 else 2*n + 1
        print(n, end = ', ')

Formula

a(n) = n if n is a prime; > n otherwise.
a(n) mod 4 = 1 unless n is a prime and n mod 4 = 3.