I came across this theorem one time and found it especially striking. I even told my friends who supposedly dislike math about it, and they were amazed, trying to calculate values for various numbers.
Lagrange's Four-Square Theorem states that any positive integer can be expressed as the sum of four perfect squares. Try this for numbers like 7, 31, 326. While we know of course of numbers that can be expressed as one square (perfect squares), we know less about numbers that can be expressed as the sum of two or three squares. (Note that 0 is a square). Try to work out this theorem for some other numbers? Can you find any that are the sum of only two squares or only three squares? Is there any pattern to these numbers?
While the proof of the theorem is beyond the scope of the Cosines Group, you can find the proof on the Wikipedia page with the same name.
As a Computer Science extension, can you create a code that will find the four squares that sum up to any given inputted number? Perhaps you can use this to locate any patterns in the system.
Feel free to post any solutions, ideas, questions, extensions, or code below.