I would like to know solution of the following one, which I had in my mind from many weeks. Given $p$ with $(10, p) = 1$, the digits $a_k$ in the recurring decimal expansion of $1/p$: This can be written as $1/P = 0.a_1 a_2 \ldots a_N$ (this value is repeatedly repeating) are obtained as follows.
1) Determine the least positive residues $r_k$ of $10^k \pmod p$: $10^k\equiv r_k \pmod p$ for $0 \leq r_k <p$.
2) Take $T = 1$ for $p\equiv 9 \pmod {10}$, $T = 3$ for $p \equiv 3 \pmod {10}$, $T = 7$ for $p\equiv 7 \pmod {10}$ and $T = 9$ for $p \equiv 1 \pmod {10}$.
Thus in all cases $pT\equiv 9 \pmod {10}$ or $pT \equiv -1 \pmod {10}$, Then $Tr_k\equiv a_k \pmod {10}$ for $0\leq a_k\leq 9$. I.e., $a_k$ are the last digits of $Tr_k$. “I would like to participate in a discussion on this problem(s)”
Edit: attempt at a clarification by user7530:
Let $p$ be an integer with $(10,p)=1$. Then $1/p$ is a periodic decimal $$1/p = 0.a_1 a_2 \ldots a_N a_1 a_2 \ldots$$ with period $N$.
I've observed that the digits $a_k$ satisfy the congruence $$a_k \equiv -p^{-1} (10^k \bmod p) \mod 10.$$
Is this formula correct? Is there a proof?
If your motivation for asking the question is “I would like to participate in a discussion about ______”, then you should not be asking here.
$\endgroup$