Math Fun Facts!
hosted by the Harvey Mudd College Math Department created, authored and ©1999-2010 by Francis Su
Subscribe to our RSS feed   or follow us on Twitter.
Get a random Fun Fact!
No subject limitations
Search only in selected subjects
    Calculus or Analysis
    Number Theory
    Other subjects
  Select Difficulty  
Enter keywords 

  The Math Fun Facts App!
  List All : List Recent : List Popular
  About Math Fun Facts / How to Use
  Contributors / Fun Facts Home
© 1999-2010 by Francis Edward Su
All rights reserved.

From the Fun Fact files, here is a Fun Fact at the Medium level:

Sums of Two Squares

Which whole numbers are expressible as sums of two (integer) squares?

Here's a theorem that completely answers the question, due to Fermat:
A number N is expressible as a sum of 2 squares if and only if in the prime factorization of N, every prime of the form (4k+3) occurs an even number of times!

Examples: 245 = 5*7*7. The only prime of the form 4k+3 is 7, and it appears twice. So it should be possible to write 245 as a sum of 2 squares (in fact, try the squares of 14 and 7). But because 7 appears only once in 42=2*3*7, it is impossible to write 42 as the sum of two squares.

A corollary of this fact is that every prime of the form (4k+1) can be written as the sum of two squares.

Presentation Suggestions:
See if your students can figure out how to write 245 as the sum of two squares, using their knowledge from the Fun Fact Products Of Sums Of Two Squares and writing 5, and 49 as the sum of two squares.

The Math Behind the Fact:
Well, if not every number can be written as a sum of two squares, perhaps a larger number of squares will suffice? Can every number be written as the sum of 3 or 4 squares? See the Fun Fact Sums of Three and Four Squares for more on these questions.

How to Cite this Page:
Su, Francis E., et al. "Sums of Two Squares." Math Fun Facts. <>.

Keywords:    sum of squares, number theory
Subjects:    number theory
Level:    Medium
Fun Fact suggested by:   Lesley Ward
Suggestions? Use this form.
Click to rate this Fun Fact...
    *   Awesome! I totally dig it!
    *   Fun enough to tell a friend!
    *   Mildly interesting
    *   Not really noteworthy
and see the most popular Facts!
New: get the MathFeed iPhone App!

Brings you news and views on math:
showcasing its power, beauty, and humanity

Want another Math Fun Fact?

For more fun, tour the Mathematics Department at Harvey Mudd College!