Yes, number theory and modular mathematics directly address this, and there are some great proofs on-line and in "popular-math" books (and in some pretty math-intensive books on the subject). Most of these disciplines deal with more advanced theory (prime numbers, divisibility, Chinese Remainder Theorem...), but they are all routed in patterns like this.

Last edited by LilMick; 11/10/10 11:49 AM.