# Le Monde puzzle [#1119]

December 7, 2019
By

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. A digit puzzle as Le weekly Monde current mathematical puzzle that sounds close to some earlier versions:

Perfect squares are pairs (a²,b²) with the same number of digits such that a²b² is itself a square. What is the pair providing a²b² less than 10⁶? Is there a solution with both integers enjoying ten digits?

The run of a brute force R code like

```cek<-function(a,b){
u<-trunc
if ((n<-u(log(a^2,ba=10)))==u(log(b^2,ba=10))&
(u(sqrt(a^2*10^(n+1)+b^2))^2==(a^2*10^(n+1)+b^2))) print(c(a,b))}```

provides solutions to the first question.

``` 2 3
 4 9
 12 20
 15 25
 18 30
 49 99
 126 155
 154 300
 159 281
 177 277
 228 100
 252 310
 285 125
```

with the (demonstrable) conclusion that the only pairs with an even number of digits are of the form (49…9²,9…9²), as for instance (49999²,99999²) with ten digits each.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.