Solution (source code)

= Solution

With $\omega=e^{2\pi i/12}$, the <quantum Fourier transform> acts by
$$
\boxed{\operatorname{QFT}_{12}|x\rangle
=\frac1{\sqrt{12}}\sum_{c=0}^{11}\omega^{xc}|c\rangle}.
$$
(The opposite phase convention gives the same measurement probabilities.)