\(\begin{array}{|rrcrrll|} \hline 1 &:97 &=& 0. &\text{ remainder }& 1 \\ 1\cdot 10 &:97 &=& 0 &\text{ remainder }& 10 \\ 10\cdot 10 &:97 &=& 1 &\text{ remainder }& 3 \\ 3\cdot 10 &:97 &=& 0 &\text{ remainder }& 30 \\ 30\cdot 10 &:97 &=& 3 &\text{ remainder }& 9 \\ 9\cdot 10 &:97 &=& 0 &\text{ remainder }& 90 \\ 90\cdot 10 &:97 &=& 9 &\text{ remainder }& 27 \\ 27\cdot 10 &:97 &=& 2 &\text{ remainder }& 76 \\ \dots\\ z\cdot 10 &:97 &=& A &\text{ remainder }& y \\ y\cdot 10 &:97 &=& 6 & \text{ remainder }& x \\ x\cdot 10 &:97 &=& 7 & \text{ remainder }& 1 & \qquad \text{ end of repeating part remainder } = 1\\ \hline \end{array} \)
We solve A:
We have:
\(\begin{array}{|rcl|} \hline \mathbf{x\cdot 10 }&\mathbf{:97} &\mathbf{=}& \mathbf{7} & \mathbf{\text{ remainder }}& \mathbf{1} \\ \text{ or }\\ x\cdot 10&&=& 7\cdot 97 & +& 1\\\\ x &=& \frac{ 7\cdot 97+1}{10} \\ x &=& \frac{ 680}{10} \\ \mathbf{x} & \mathbf{=}& \mathbf{68}\\ \hline \end{array}\)
...and we have:
\(\begin{array}{|rcl|} \hline \mathbf{y\cdot 10 }&\mathbf{:97} &\mathbf{=}& \mathbf{6} & \mathbf{\text{ remainder }}& \mathbf{x} \\ \text{ or }\\ y\cdot 10&&=& 6\cdot 97 & +& 68\\\\ y &=& \frac{ 6\cdot 97+68}{10} \\ y &=& \frac{ 650}{10} \\ \mathbf{y} & \mathbf{=}& \mathbf{65}\\ \hline \end{array}\)
...and...
\(\begin{array}{|rcl|} \hline \mathbf{z\cdot 10 }&\mathbf{:97} &\mathbf{=}& \mathbf{A} & \mathbf{\text{ remainder }}& \mathbf{y} \\ \text{ or }\\ z\cdot 10&&=& A\cdot 97 & +& 65\\\\ \hline \end{array}\)
We have to solve the Diophantine equation \(10z -97A = 65.\)
We can do it with a variation of the Euclidean algorithm, or we can do it with Euler's Method etc.
I will do it with Euler's theorem:
\(\begin{array}{l} \text{In number theory, }\\ \text{Euler's theorem (also known as the Fermat–Euler theorem or Euler's totient theorem)}\\ \text{states that if } \mathbf{m} \text{ and } \mathbf{a} \text{ are coprime positive integers, then }\\ \hline a^{\varphi (m)} \equiv 1 \pmod{m} \qquad \text{, if }~ gcd(a,m)=1 \\\\ \text{or} \\ \\ a^{\varphi (m)} \pmod{m} \equiv 1 \qquad | \qquad \cdot \frac{1}{a}\\ \frac{ a^{\varphi (m)} } {a} \pmod{m} \equiv \frac{1}{a} = a^{-1}\\ a^{\varphi (m)-1} \pmod{m} \equiv \frac{1}{a} = a^{-1}\\ \begin{array}{|rcl|} \hline a^{-1} = \frac{1}{a} \equiv a^{\varphi (m)-1} \pmod{m} \qquad \text{, if }~ gcd(a,m)=1\\ \hline \end{array} \end{array} \)
We need this Formula: \( \begin{array}{|rcl|} \hline a^{-1} = \frac{1}{a} \equiv a^{\varphi (m)-1} \pmod{m} \qquad \text{, if }~ gcd(a,m)=1\\ \hline \end{array}\)
an we need the Euler's Totient Function: \(\varphi(10) = 10\cdot (1- \frac{1}{2} )\cdot (1- \frac{1}{5} ) = 4, \text{ because } ~ 10 = 2\cdot 5\)
so we have:
\(\begin{array}{rcl} 10z -97A &=& 65\\\\ 97A &=& 10\cdot z - 65 \qquad | \qquad \pmod{10} \\ 97A &\equiv& -65 \pmod{10} \\ 97A &\equiv& -65 +7\cdot 10 \pmod{10} \\ \mathbf{97A} & \mathbf{\equiv}& \mathbf{5 \pmod{10}}\\\\ 97\cdot A\cdot \frac{1}{97} & \equiv & \frac{5}{97} \pmod{10}\\ A & \equiv & 5\cdot \frac{1}{97} \pmod{10}\\\\ \frac{1}{97} \pmod{10} &\equiv& 97^{\varphi(10)-1} \pmod{10} \qquad \text{ see Formula above,}\\ &&\qquad \text{we can do it because, } ~gcd(97,10)=1\\ &\equiv& 97^{4-1} \pmod{10}\\ &\equiv& 97^3 \pmod{10}\\ &\equiv& 912673 \pmod{10}\\ &\equiv& 3 \pmod{10}\\\\ A & \equiv & 5\cdot \frac{1}{97} \pmod{10}\\\\ A & \equiv & 5\cdot 3 \pmod{10}\\ A & \equiv & 15 \pmod{10}\\ A & \equiv & 5 \pmod{10}\\ \mathbf{A} & \mathbf{=} & \mathbf{5} \end{array}\)