Can "(input * X) mod Y" with N iterations be computed in less than N operations?
This algorithm is computing $$I'=I\cdot Y^N\bmod X$$. Using a standard square and multiply algorithm you need at most $\lceil 2\log_2(N)\rceil+1$ modular multiplications to compute $I'$.  This is about 33 multiplications for the given example of $N=10,000$ which probably counts as this algorithm being &quot;predictable&quot;.