Solution (source code)

= Solution

Euler's theorem states that $a^{\phi(m)}\equiv1\pmod m$ whenever $\gcd(a,m)=1$, where $\phi(m)$ counts the invertible <residue> classes. For each prime-power divisor, the same theorem gives $a^{\phi(p_i^{e_i})}\equiv1\pmod{p_i^{e_i}}$. Since the exponent defined in the source is a multiple of every one of these exponents, raising that congruence to the corresponding integer power gives
$$
a^{\lambda(m)}\equiv1\pmod{p_i^{e_i}}.
$$
The prime powers are pairwise <coprime>, so their product divides $a^{\lambda(m)}-1$, proving the congruence modulo $m$.

For the displayed composite integer,
$$
\lambda(561)=\operatorname{lcm}(2,10,16)=80,\qquad560=7\cdot80.
$$
Thus every integer <coprime> to 561 satisfies $\boxed{a^{560}\equiv1\pmod{561}}$. This is a <Carmichael number>. The source's prime-power least common multiple need not be the minimal universal exponent for all moduli; for powers of two its definition can exceed the usual <Carmichael function>. No minimality claim is needed here.