## Le Monde puzzle [#939]

**A** Le Monde mathematical puzzle about special integers:

Find all integers with less than 11 digits that are perfect squaresandcan be written as a(a+6), a being an integer.

**E**leven digits being too much for a brute force exploration of the form `for (t in 1:1e11)`…, some preliminary analysis is needed, but I could not figure out a reason why there is no solution apart from 2… (I checked up to 1e8!)

Since I had “guessed” the above puzzle from the solution published one week later (!), I checked the quality of my guesswork with my friend Jean-Louis Fouley, who gave me the genuine question, based on a different interpretation of *a(a+6)*:

Find all integers with less than 11 digits that are perfect squaresandcan be written as x concatenated with (x+6), x being an integer.

This is more open to brute-force R exploration (with some help from stack overflow) since x only has five digits at most!

perfect=function(b){ x=FALSE a=trunc(sqrt(b)) for (i in a:(a+1)) if (i^2==b) x=TRUE return(x)} for (x in 1:(1e6-1)) if (perfect( as.numeric(paste(c(as.numeric(strsplit(as.character(x), "")[[1]]), as.numeric(strsplit(as.character(x+6), "")[[1]])),collapse="")))) print(x)

Which returns

[1] 15 [1] 38

and then crashes for x=99994, because

strsplit(as.character(1e+05), "")

does not return the six digits of 1e+05 but

[[1]] [1] "1" "e" "+" "0" "5"

instead. Except for this value of x, no other solution is found using this R code. And for x=99994, y=99994100000 is not a perfect square.

December 11, 2015 at 3:15 pm

Why only 2? Simple. You are looking for a solution of the type a(a+6)=y^2. So a^2+6a-y^2=0. For this to have an integer solution then sqrt(9+y^2) needs to be integer, and the only time this happens is when y=4, so y^2=16 and a=2.

Algebra to the rescue!!

December 11, 2015 at 7:10 pm

Is a = -8 not also a solution?

December 12, 2015 at 10:39 am

Since there is no original version for that puzzle, why not?! It is the exact symmetric of a=2.

December 12, 2015 at 11:49 am

Thanks. I did not even look at the second degree equation!