I got this exercise in arithmetic class (I'm a french student but let me translate the problem)
In this thread I only talk about questions from question 2) on the paper.
Let n and p be 2 integers greater or equal than 2 such that $gcd(n,p)=1$. We want to show that there is $ k \in \mathbb{Z} $ such that $n^k \equiv 1\mod p $. (I find this closed to De Fermat's little theorem)
Q1) Find the smallest k for n=4 and p=7
Q2) If p is prime say something about the existence of k
Q3) p is no more prime Let $r_k$ be the rest of the division algorithm of $n^k$ by $p$. Show that there is two positive and different integers i and j such that $r_i =r_j$
Q4) We suppose that $i<j$ . Show that $n^{j-i} \equiv 1 \mod p$
Let n be an odd number that doesn't end by 5.
Q5) Show that $gcd(9n;10)=1$
Q6) Show that there is a multiple of n which is a repunit number (base 10)
Q7) With n=101 find a multiple of n which is a repunit (give your approach)
With the pigeonhole principle I answered Q3. For Q4 I calculate $n^{j-i} -1 $ but I don't find any whole numbers times p which give me $n^{j-i} -1 $.
(I don't know if it's the same symbol for english but '^' stands for the gcd)
For Q5) there is only 4 cases :
$n \equiv 1 \mod 10$
$n \equiv 3 \mod 10$
$n \equiv 7 \mod 10$
$n \equiv 9 \mod 10$
From that that's easy to show that $gcd(9n,10)=1.$
For the Q6) we got the same hypothesis from last proof now we have (9n)^10=1. So it exists an integer l such that $(9n)^l \equiv 1 \mod 10$. Then there is k in $\mathbb{Z}$ such that $$ (9n)^l = 10k+1$$ I know that for $n \geq 2 $ we have $9U_n = 10^n -1$ with Un the nth repunit number in base 10. But maybe this is obvious but I don't manage to show that there is a multiple of n which is a repunit number (always base 10).
So if you can help me with this problem, please.
(For Q7 with a smalll python programm I've got 101*11 is a repunit number)
EDIT 1 I changed the french notation to be more comprehensible
For Q4, \begin{align*} n^i n^{j-i} = n^j \equiv n^i &\mod p\\ \implies n^i(n^{j-i}-1) \equiv 0 &\mod p \end{align*} using the fact that $\operatorname{gcd}(n,p)=1$ you should be able to finish from there.
For Q6, applying the result the other way (taking $10$ to the power instead of $9n$) yields $$10^k -1 \equiv 0 \mod 9n,$$ which bears a closer resemblance to the formula you want to apply. Does this help?