# Six digit perfect square (with conditions)

I'm looking at a problem set question that asks me to find all the $6$-digit numbers ABCDEF that satisfy the condition that $2ABC=DEF$ (so for example, $100200$). They also need to satisfy the condition that $ABCDEF+1$ is a perfect square.

I've tried working on the problems from different ways, but I've come up with nothing.

My most recent attempt was to break $ABCDEF$ up so that $10^5A+10^4B+\dots+F$ became my new number. Then, I substituted so that I got

$$10^5A+10^4B+10^3C+2(10^2A+10^1B+C)=1002(100A+10B+C)$$

I was hoping that I could do something with digital roots to get the values of perfect squares such that $dr[1002(100A+10B+C)+1] = 1$ or $4$ or $7$ or $9$ ($1,4,7$ and $9$ being the digital roots that yield perfect squares), but it doesn't look easy and I'm pretty lost. I believe the question has to do with Number Theory, but I'm not sure since the class I'm in is fairly disorienting.

Any help would be appreciated.

## 1 Answer

If $2\cdot ABC=DEF$, then your number is $$x=1000\cdot ABC + DEF=1002\cdot DEF = y^2-1=(y+1)(y-1);$$ hence $1002=2\cdot 3 \cdot 167$ divides $(y+1)(y-1)$, and in particular $y \equiv \pm 1$ mod $167$. Checking $x=(167 k \pm 1)^2 - 1$ for $k=1,2,3,\ldots$ quickly yields the only two solutions: $x=112224$ and $x=444888$.