Cody Problem 656 introduced the Euler totient function phi(x), which counts the number of integers smaller than x
that are relatively prime to x--that is, that share no common factors with x other than 1. Its definition implies that phi(x) < x. Cody Problem 61052 deals with the Dedekind psi function psi(x), which is always greater than x.
What happens if the function f(x) = phi(psi(x)) is applied repeatedly? If , then psi(9) = 12 and phi(12) = 4. The next iteration gives psi(4) = 6 and phi(6) = 2. The third iteration gives psi(2) = 3 and phi(3) = 2. After this step—i.e., after three iterations, the results will repeat.
Write a function to determine the number of iterations after which f(x) = phi(psi(x)) repeats. In other words, determine the step at which f(x) = x.

Solution Stats

6 Solutions

4 Solvers

Last Solution submitted on Dec 28, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...