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.
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
Keywords
Links
- Ya-Ping Lu, Table of n, a(n) for n = 1..10000
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
Comments