Problem 61053. Determine when iterations of phi(psi(x)) repeat

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

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Oct 27, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers2

Suggested Problems

More from this Author314

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!