<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/le-monde-puzzle-1062/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://xianblog.wordpress.com/2018/07/28/le-monde-puzzle-1062/"> R – Xi'an's Og</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><strong><img data-orig-file="https://xianblog.files.wordpress.com/2015/10/lemondapari.jpeg?w=456" data-orig-size="275,183" data-medium-file="https://xianblog.files.wordpress.com/2015/10/lemondapari.jpeg?w=456?w=275" data-attachment-id="35411" data-image-meta="{" data-image-description="" src="https://xianblog.files.wordpress.com/2015/10/lemondapari.jpeg?w=456" data-permalink="https://xianblog.wordpress.com/2015/10/25/le-monde-puzzle-934/lemondapari/" data-large-file="https://xianblog.files.wordpress.com/2015/10/lemondapari.jpeg?w=456?w=275" alt="lemondapari" data-image-title="lemondapari" sizes="(max-width: 275px) 100vw, 275px" data-comments-opened="1" class="wp-image-35411" data-recalc-dims="1">A</strong> simple <a rel="nofollow" href="https://xianblog.wordpress.com/2011/09/03/le-monde-puzzle-website/" title="Le Monde puzzle [website]" target="_blank">Le Monde mathematical puzzle</a> none too geometric:</p>
<ol>
<li><em>Find square triangles which sides are all integers and which surface is its perimeter.</em></li>
<li><em>Extend to non-square rectangles.</em></li>
</ol>
<p>No visible difficulty by virtue of Pythagore’s formula:</p>
<pre>for (a in 1:1e4)
for (b in a:1e4)
  if (a*b==2*(a+b+round(sqrt(a*a+b*b)))) print(c(a,b))</pre>
<p>produces two answers</p>
<pre> 5 12
 6  8
</pre>
<p><a rel="nofollow" href="https://xianblog.files.wordpress.com/2013/06/img_0154-e1371713852183.jpg" target="_blank"><img data-orig-file="https://xianblog.files.wordpress.com/2013/06/img_0154-e1371713852183.jpg?w=375&amp;h=226&amp;fit=375%2C226&amp;resize=375%2C226" data-orig-size="4596,2764" data-medium-file="https://xianblog.files.wordpress.com/2013/06/img_0154-e1371713852183.jpg?w=375&amp;h=226&amp;fit=375%2C226&amp;resize=375%2C226?w=300" data-attachment-id="21010" data-image-meta="{" data-image-description="" src="https://xianblog.files.wordpress.com/2013/06/img_0154-e1371713852183.jpg?w=375&h=226&fit=375%2C226&resize=375%2C226" data-permalink="https://xianblog.wordpress.com/2013/06/25/london-herons-just-for-one-day/img_0154/" data-large-file="https://xianblog.files.wordpress.com/2013/06/img_0154-e1371713852183.jpg?w=375&amp;h=226&amp;fit=375%2C226&amp;resize=375%2C226?w=450" alt="" data-image-title="heron in Regent Park, June 20, 2013" sizes="(max-width: 375px) 100vw, 375px" width="375" data-comments-opened="1" class="wp-image-21010" data-recalc-dims="1" height="226"></a>and in the more general case, <a rel="nofollow" href="https://www.wikihow.com/Calculate-the-Area-of-a-Triangle" target="_blank">Heron’s formula</a> to the rescue!,</p>
<pre>for (a in 1:1e2)
for (b in a:1e2)
for (z in b:1e2){
  s=(a+b+z)/2
  if (abs(4*s-abs((s-a)*(s-b)*(s-z)))&lt;1e-4) print(c(a,b,z))}</pre>
<p>returns</p>
<pre> 4 15 21
 5  9 16
 5 12 13
 6  7 15
 6  8 10
 6 25 29
 7 15 20
 9 10 17
</pre>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://xianblog.wordpress.com/2018/07/28/le-monde-puzzle-1062/"> R – Xi'an's Og</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/bk6CafXXdzg" height="1"></a></div>