Solution
= Solution
The equality $f(x)=4$ holds exactly for $x\equiv1\pmod3$. Projecting onto the measured second-register value and normalizing gives
$$
\boxed{|\alpha\rangle
=\frac12\bigl(|1\rangle+|4\rangle+|7\rangle+|10\rangle\bigr)}.
$$
= Solution
The equality $f(x)=4$ holds exactly for $x\equiv1\pmod3$. Projecting onto the measured second-register value and normalizing gives
$$
\boxed{|\alpha\rangle
=\frac12\bigl(|1\rangle+|4\rangle+|7\rangle+|10\rangle\bigr)}.
$$