If one takes in general $(\star)\, \,x^2-dy^2=C$ where $d$, $C$ in $\mathbb{N}$.


Taking $d=w^2p^2+p$ with $w\in \mathbb{Q}\ge 1$ and $p\in \mathbb{Z}$ which is verified (explained later), for the matrix $$A=\begin{pmatrix}2w^2p+1&2w(w^2p^2+p)\\2w&2w^2p+1\end{pmatrix}$$ if $X\_0$ is a solution to $(\star)$ then $AX\_0$ is another one.


Now $w$ could be taken in a cool way basicaly say $d=a^2b^2+cb$ with $c\in\mathbb{Z}$, $|c|<|a|$ and $c$ coprime with $b$ and $a$, letting
$w=\frac{a}{c}$ and $p=cb$ the matrix $A$ is in $\mathbb{Q}$ but can have a power $A^n$ with integer entries. So to say that i didn't find any reference for this idea which is surprising. This is related and known of course as a Pell equation when $w\in \mathbb{N}$.


A question is if there is a related topic discussion to this approach since Pell equations are known, and as a conjecture to give certain family of $A$ with $A^n$ of integer entries. (It appears there are many). Thanks


Edit, i'll illustrate this in an example just for clarity:
$$x^2-2021y^2=d^2$$ one solution is $(d,0)$, i took $2021$ by chance as it is within what i can get, (i don't know if it should work for $2020$) since $2021=\frac{45^2}{4^2}4^2-4$. An easy argument says if the numerator of $w$ here $45$ is $5 \pmod{8}$ Then $A^3\in \mathbb{M}\_2(\mathbb{Z})$ so


$$A=\begin{pmatrix}-1011.5&45472.5\\22.5&-1011.5\end{pmatrix}$$ and $$A^3=\begin{pmatrix}-4.139590049\times 10^9&1.8609747948\times 10^{11}\\9.2081880\times 10^7&-4.139590049\times 10^9\end{pmatrix}.$$


Edit. It seems such $A$ has an all integer power $A^n$ if and only if $c$ is a power of two and mainly $|c|= 1, 2, 4$,



A Pell like equation
If I understand correctly, your question is the following: suppose that for a given positive integer $d$ the equation


$$\displaystyle x^2 - dy^2 = c \text{ } (\ast)$$


has a solution in integers $x,y$ for some integer $c$. Then does there exist an infinite family of solutions generated by $A^k (x,y)^T$ for some $A \in \text{GL}\_2(\mathbb{Z})$ having infinite order?


The answer is yes, and was answered completely by Siegel. Indeed, the equation $(\ast)$ has finitely many solutions modulo the action induced by the unit group of the ring of integers of $\mathbb{Q}(\sqrt{d})$, which always has rank one. See the following paper of Siegel: [The average measure of quadratic forms with given determinant and signature](https://www.jstor.org/stable/1969296?seq=1).


