OFFSET
1,3
COMMENTS
Conjecture 1: Iterating map f on an integer n (n > 1) results in a different integer, or f^i(n) != f^j(n) if i != j, where f^i(n) and f^j(n) are the i-th and j-th iterations of map f on n respectively.
Conjecture 2: An integer n eventually reaches 1 when map f is applied to n repeatedly.
FORMULA
a(2*k+1) = 2*a(2*k) if 2*k+1 is not a prime.
a(2*k+2) = a(2*k) + 1, where k >= 1.
PROG
(Python)
from sympy import isprime
for n in range(1, 101):
if isprime(n) == 1 and n != 2: a = n*n - 2
elif n%2 == 0: a = n/2
else: a = n - 1
print(a)
(PARI) a(n) = if (n%2, if (isprime(n), n^2-2, n-1), n/2); \\ Michel Marcus, Jan 22 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Jan 21 2021
STATUS
approved