{"id":4436,"date":"2014-10-21T12:19:51","date_gmt":"2014-10-21T11:19:51","guid":{"rendered":"http:\/\/emilkirkegaard.dk\/en\/?p=4436"},"modified":"2014-10-21T12:19:51","modified_gmt":"2014-10-21T11:19:51","slug":"is-the-summed-cubes-equal-to-the-squared-sum-of-counting-integer-series","status":"publish","type":"post","link":"https:\/\/emilkirkegaard.dk\/en\/2014\/10\/is-the-summed-cubes-equal-to-the-squared-sum-of-counting-integer-series\/","title":{"rendered":"Is the summed cubes equal to the squared sum of counting integer series?"},"content":{"rendered":"<div class=\"oceanwp-oembed-wrap clr\">\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\">Martin Gardner is 100 today. 1\u00b3+2\u00b3+3\u00b3+4\u00b3 = 100 = (1+2+3+4)\u00b2. Does the sum of the first numbers cubed always equal the square of their sum?<\/p>\n<p>&mdash; Matt Parker (@standupmaths) <a href=\"https:\/\/twitter.com\/standupmaths\/status\/524470545199673344?ref_src=twsrc%5Etfw\">October 21, 2014<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/div>\n<p>R can tell us:<\/p>\n<pre>DF.numbers = data.frame(cubesum=numeric(),sumsquare=numeric()) #initial dataframe\r\nfor (n in 1:100){ #loop and fill in\r\n\u00a0 DF.numbers[n,\"cubesum\"] = sum((1:n)^3)\r\n\u00a0 DF.numbers[n,\"sumsquare\"] = sum(1:n)^2\r\n}\r\n\r\nlibrary(car) #for the scatterplot() function\r\nscatterplot(cubesum ~ sumsquare, DF.numbers,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 smoother=FALSE, #no moving average\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 labels = rownames(DF.numbers), id.n = nrow(DF.numbers), #labels\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 log = \"xy\", #logscales\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 main = \"Cubesum is identical to sumsquare, proven by induction\")\r\n\r\n#checks that they are identical, except for the name\r\nall.equal(DF.numbers[\"cubesum\"],DF.numbers[\"sumsquare\"], check.names=FALSE)<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/cubesum_sumsquare.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4437\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/cubesum_sumsquare.png\" alt=\"cubesum_sumsquare\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p>One can increase the number in the loop to test more numbers. I did test it with 1:10000, and it was still true.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Martin Gardner is 100 today. 1\u00b3+2\u00b3+3\u00b3+4\u00b3 = 100 = (1+2+3+4)\u00b2. Does the sum of the first numbers cubed always equal the square of their sum? &mdash; Matt Parker (@standupmaths) October 21, 2014 R can tell us: DF.numbers = data.frame(cubesum=numeric(),sumsquare=numeric()) #initial dataframe for (n in 1:100){ #loop and fill in \u00a0 DF.numbers[n,&#8221;cubesum&#8221;] = sum((1:n)^3) \u00a0 DF.numbers[n,&#8221;sumsquare&#8221;] [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1766],"tags":[1931,1979],"class_list":["post-4436","post","type-post","status-publish","format-standard","hentry","category-math-science","tag-programming","tag-r","entry"],"_links":{"self":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/4436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/comments?post=4436"}],"version-history":[{"count":1,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/4436\/revisions"}],"predecessor-version":[{"id":4438,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/4436\/revisions\/4438"}],"wp:attachment":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/media?parent=4436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/categories?post=4436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/tags?post=4436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}