{"id":349,"date":"2019-06-26T23:42:33","date_gmt":"2019-06-26T23:42:33","guid":{"rendered":"http:\/\/funfacts.104.42.120.246.xip.io\/?page_id=349"},"modified":"2019-08-07T17:19:23","modified_gmt":"2019-08-07T17:19:23","slug":"sums-of-two-squares-ways","status":"publish","type":"page","link":"https:\/\/math.hmc.edu\/funfacts\/sums-of-two-squares-ways\/","title":{"rendered":"Sums of Two Squares Ways"},"content":{"rendered":"\n<p>In the Fun Fact&nbsp;<a href=\"https:\/\/www.math.hmc.edu\/cgi-bin\/funfacts\/main.cgi?Subject=00&amp;Level=0&amp;Keyword=Sums+of+Two+Squares\">Sums of Two Squares<\/a>, we&#8217;ve seen which numbers can be written as the sum of two squares. For instance, 11 cannot, but 13 can (as 3<sup>2<\/sup>+2<sup>2<\/sup>). A related question, with a surprising answer, is: on average, how many ways can a number can be written as the sum of two squares?<\/p>\n\n\n\n<p>We should clarify what we mean by&nbsp;<em>average<\/em>. Let W(N) is the number of ways to write N as the sum of two squares. Thus W(11)=0, and W(13)=8 (as sums of squares of all possible combinations of +\/-3 and +\/-2 , in either order).<\/p>\n\n\n\n<p>So if A(N) is the average of the numbers W(1), W(2), &#8230;, W(N), then A(N) is the average number of ways&nbsp;<em>the first N numbers<\/em>&nbsp;can be written as the sum of two squares. Then it makes sense to take the&nbsp;<a href=\"https:\/\/www.math.hmc.edu\/cgi-bin\/funfacts\/main.cgi?Subject=00&amp;Level=0&amp;Keyword=limit\">limit<\/a>of A(N) as N goes to infinity to get the &#8220;average&#8221; number of ways to write a number as the sum of two squares, over&nbsp;<em>all<\/em>&nbsp;positive whole numbers.<\/p>\n\n\n\n<p>A surprising fact is that this limit exists, and it is Pi!<\/p>\n\n\n\n<p><strong>Presentation&nbsp;Suggestions:<\/strong><br>This might be presented after a discussion of lattice points in&nbsp;<a href=\"https:\/\/www.math.hmc.edu\/cgi-bin\/funfacts\/main.cgi?Subject=00&amp;Level=0&amp;Keyword=Pick%27s+Theorem\">Pick&#8217;s Theorem<\/a>.<\/p>\n\n\n\n<p><strong>The&nbsp;Math&nbsp;Behind&nbsp;the&nbsp;Fact:<\/strong><br>The proof is as neat as the result! Every solution (x,y) to x<sup>2<\/sup>+y<sup>2<\/sup>=N can be thought of as a&nbsp;<a href=\"https:\/\/www.math.hmc.edu\/cgi-bin\/funfacts\/main.cgi?Subject=00&amp;Level=0&amp;Keyword=lattice%20point\">lattice point<\/a>&nbsp;in the plane, i.e., a point with integer coordinates. Such a lattice point lies on a circle of radius Sqrt(N).<\/p>\n\n\n\n<p>Therefore, the sum of W(1) through W(N) counts the number of lattice points in the plane&nbsp;<em>inside<\/em>&nbsp;or on a circle of radius Sqrt(N) (except for the origin), and the average A(N) is this number of lattice points divided by N. But as N goes to infinity, the number of lattice points inside this circle is approximately the area of the circle, hence Pi times the radius squared: Pi*Sqrt(N)<sup>2<\/sup>&nbsp;or Pi*N. Therefore A(N) is approximately Pi, and this approximation gets better and better as N goes to infinity!<\/p>\n\n\n\n<p>Counting the the number of lattice points inside a circle is known as&nbsp;<em>Gauss&#8217; circle problem<\/em>. Also, see several other Fun Facts about&nbsp;<a href=\"https:\/\/www.math.hmc.edu\/cgi-bin\/funfacts\/main.cgi?Subject=00&amp;Level=0&amp;Keyword=sums%20of%20two%20squares\">sums of two squares<\/a>&nbsp;or formulas&nbsp;<a href=\"https:\/\/www.math.hmc.edu\/cgi-bin\/funfacts\/main.cgi?Subject=00&amp;Level=0&amp;Keyword=for%20pi\">for pi<\/a>.<\/p>\n\n\n\n<p><strong>How to Cite this Page:<\/strong>&nbsp;<br>Su, Francis E., et al. &#8220;Sums of Two Squares Ways.&#8221;&nbsp;<em>Math Fun Facts<\/em>. &lt;http:\/\/www.math.hmc.edu\/funfacts&gt;.<\/p>\n\n\n\n<p><strong>Fun Fact suggested by:<\/strong>   <br>Darryl Yong<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Fun Fact&nbsp;Sums of Two Squares, we&#8217;ve seen which numbers can be written as the sum of two squares.&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"tags":[8,4,10,12,172,171,170],"class_list":["post-349","page","type-page","status-publish","hentry","tag-geometry","tag-medium","tag-numtheory","tag-other","tag-pi-formulas","tag-picks-theorem","tag-sums-of-squares"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":2,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/349\/revisions"}],"predecessor-version":[{"id":1017,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/349\/revisions\/1017"}],"wp:attachment":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}