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.

A384713 The number of steps that n requires to reach 1 under the map: x-> x^2 - 1 if x is an odd prime, x/2 if x is even, x - lpf(x) otherwise where lpf(x) is the least prime factor of x. a(n) = -1 if 1 is never reached.

Original entry on oeis.org

0, 1, 4, 2, 8, 5, 9, 3, 6, 9, 11, 6, 12, 10, 7, 4, 12, 7, 14, 10, 8, 12, 14, 7, 11, 13, 8, 11, 15, 8, 14, 5, 9, 13, 9, 8, 16, 15, 9, 11, 16, 9, 17, 13, 10, 15, 17, 8, 10, 12, 9, 14, 18, 9, 13, 12, 10, 16, 17, 9, 19, 15, 10, 6, 10, 10, 20, 14, 11, 10, 18, 9, 20
Offset: 1

Views

Author

Ya-Ping Lu, Jun 23 2025

Keywords

Comments

First 8 terms are the same as those in A339991.
Conjecture: a(n) != -1.

Crossrefs

Cf. A339991.

Programs

  • Python
    from sympy import isprime, primefactors
    def A384713(n, c = 0):
        while n != 1: n = n//2 if n%2 == 0 else n*n-1 if isprime(n) else n-min(primefactors(n)); c += 1
        return c