I checked 3 times that I have written the right program but it's not working in question part. I don't know why?
This was asked in my number theory quiz and I was unable to solve it.
Question: Define $ S= \{ h k_1+ gk_2 |$ $ 1\leq g\leq k_1$, $1\leq h \leq k_2$ $(g, k_1)=1 $ Then prove that S is complete system of residues$\bmod k_1 k_2$ .
Clearly there are $k_1 k_2$ elements.
But I am unable to prove that all elements are distinct mod $k_1 k_2$ . All I am able to prove that $(h- h' )k_1=0(mod k_1k_2) $ and similar for g.
Can you please help in proving that elements are distinct?
I am adding another question which is similar but I am unable to solve it and have a similar problem.
Consider $(k_1, k_2)=1$ S'={ {$h k_1 +g k_2}$ | $1\leq g \leq k_1 $ , $ 1\leq h \leq k_2 $ , $ (g, k_1) =1$ , $(h, k_2) =1 $ ). Then prove that S' forms a complete reduced residue system $ mod k_1 k_2$.
I have proved that there exists $\phi (k_1 k_2) $ elements . But again problem is in proving that they are distinct. I have obtained a result similar to that of S but not what I must.
It's my humble request to help me in both the problems.
The statement is false; take for example $k_1=k_2=3$ and $(g,h)=(1,2)$ and $(g',h')=(2,1)$. Then $$gk_1+hk_2=1\cdot3+2\cdot3=9\qquad\text{ and }\qquad g'k_1+h'k_2=2\cdot3+1\cdot3=9.$$