Two applications of number theory to discrete tomography