## Le Monde puzzle [#1119] 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.

### 2 Responses to “Le Monde puzzle [#1119]”

1. Le Monde puzzle [#1119] | R-bloggers Says:

[…] article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) […]