  We show how methods of number theory can be used to study anomalies in gauge
quantum field theories in spacetime dimension two. To wit, the anomaly
cancellation conditions for the abelian part of the local anomaly admit
solutions if and only if they admit solutions in the reals and in the $p$-adics
for every prime $p$ and we use this to build an algorithm to find all
solutions.
