From infinite ergodic theory to number theory (and possibly back)