<s>[INST] Find x and y such that $xx...x6yy...4=k^2$. Find  x and y such that $N=xx...x6yy...4=k^2$, where number of x and y is n.
Solution:
Supose n=1 and N=x6y4 and we must have:
$(x6y)\times 10 +4=k^2$
⇒ $(x6y)\times 10=(k-2)(k+2)$
That is the last digit of (k+2) or (k-2) must be zero, let $k+2 ≡0 \ mod 10$ ⇒ $k ≡8 \mod 10$
Let $k= a8$ , we can see that if $a=6$ then:
$68^2=4624$ ⇒ $x=4, y=2$ and $66...8^2=44...622...4$
Also if a=9 then:
$98^2=9609$ ⇒ $x=9, y=0$ and $99...8^2=99...600...4$
But this seems to be a sort of lucky solution. Can someone gives a more reasonable algorithm? 
 [/INST] This is an interesting problem but so far I only have a partial answer.
$k$ must be of the form $10l+2$ or $10l+8$. Let's look at the second of these possibilities.
$$(10l+8)^2=\frac {10^n-1}{9}10^{n+2}x+\frac {10^n-1}{9}10y +6\times 10^{n+1}+4$$
$$100l^2+160l+64=\left(\frac {10^n-1}{9}\right)\left (10^{n+2}x+10y+540\right )+64                  $$
$$l(10l+16)=\left(\frac {10^n-1}{9}\right)\left (10^{n+1}x+y+54\right )$$
Now consider solutions where $l=\frac {10^n-1}{9}t$ for some integer $t$. (However there could be other solutions).
We now have $t(10l+16)=10^{n+1}x+y+54$ and so $$(10^n-1)10t^2+144t=10^{n+1}9x+9y+486$$
$$10^{n+1}(t^2-9x)y=10t^{2}-144t+9y+486.$$
Now $x$ and $y$ are digits and for reasonably large $n$ we must have $t^2=9x$. The possibilities are 
$x=1,t=3$. Then $y$ is negative.
$x=4,t=6$. Then $y=2.$
$x=t=9$. Then $y=0.$
We thus have the two solutions that you know.
</s>