Determine number of all $\left\{P,Q,R,k \right\}$, such that $P_{(2k)}-Q_{(k)}=(R_{(k)})^2$ The Problem is:

Let for any $D$ and $k$,
$D_{(k)}=\underbrace{\overline {DDD \cdots D}}_{\text{$k$-tuple}}$
where, $ D\in\mathbb{Z^{+}}, D≤9$ and $k\in\mathbb{Z^{+}}, k≤2018.$
Determine number of all $\left\{P,Q,R,k \right\}$, such that
$$P_{(2k)}-Q_{(k)}=(R_{(k)})^2$$

Here is my method:


Is my method and solution / answer correct? Can MSE confirm the accuracy of my solution?
Thank you very much!
 A: I didn't find any error in your solution. A thing to add: you could jump a few steps on $\frac{2P - Q}{10^k-1}$ by using that $\forall k \geq 1, 9|10^k - 1$. So $9|2P-Q$, with $2P-Q \leq 2*9 - 1 = 17 \implies 2P-Q \in \{0,9\}$.
Good job!
A: You are missing many solutions because you erroneously assumed that $\dfrac{2P-Q}{10^k-1}$ must be an integer.  This is a false assumption.  You can only conclude that $\dfrac{9(2P-Q)}{10^k-1}$ is an integer.
From the line
$$9P(10^k+1)-9Q=R^2(10^k-1),$$ 
we have
$$9P+\frac{9(2P-Q)}{10^k-1}=R^2\,.\tag{*}$$
This shows that $10^k-1\mid 9(2P-Q)$.  As $-9\leq 2P-Q\leq 18$, we then have 
$$-1<-\frac{9\cdot 9}{10^2-1}\leq \frac{9(2P-Q)}{10^k-1}\leq \frac{9\cdot 18}{10^2-1}<2$$
for all integers $k\geq 2$.  Consequently, one of the following scenario must be true:


*

*$k=2$ and $2P-Q=11$,

*$2P-Q=0$, or

*$k=1$ and $2P-Q\neq 0$.


In the case $k=2$ and $2P-Q=11$, we have the following possibilities: $(P,Q)=(6,1)$, $(P,Q)=(7,3)$, $(P,Q)=(8,5)$, and $(P,Q)=(9,7)$.  Only $(P,Q)=(7,3)$ yields an integral value of $R$, making $$(P,Q,R,k)=(7,3,8,2)$$ the only solution in this case.
In the case $2P=Q$, then $9P$ must be a square, and so $P\in\{1,4,9\}$.  As $2P=Q\leq 10$, we conclude that $P\in\{1,4\}$.  Hence, the solutions in this case are $$(P,Q,R,k)=(1,2,3,k)$$ and $$(P,Q,R,k)=(4,8,6,k)$$ for any integer $k\geq 1$.  There are also the solutions $$(P,Q,R,k)=(0,0,0,k)$$ for any integer $k\geq 1$ if you allow the digits to be $0$.
In the case $k=1$ and $2P-Q\neq 0$, we have by (*) that $R^2=11P-Q$.  We can just run case by case starting from $P=0$ to $P=9$: $$(P,Q,R,k)=(1,7,2,1)\,,$$ $$(P,Q,R,k)=(2,6,4,1)\,,$$ $$(P,Q,R,k)=(3,8,5,1)\,,$$ $$(P,Q,R,k)=(5,6,7,1)\,,$$ $$(P,Q,R,k)=(6,2,8,1)\,,$$ and $$(P,Q,R,k)=(8,7,9,1)\,.$$
