If p is a prime number greater than 3, then what all remainders are possible when $(p^3+15)$ is divided by 18? [duplicate]

Please check if my solution is correct or not :-

Since p is a prime number and greater than 3 therefore it will be of form $$6k+1$$ or $$6k-1$$

$$Case 1:-$$ When $$p=6k+1$$

$$(6k+1)^3+(6k+3)=6k+4$$

$$18k+4/10/16$$

$$Case 2:-$$ When $$p=6k-1$$

$$(6k-1)^3+(6k+3)=6k+2$$

$$18k+2/8/14$$

Therefore there are 6 different remainders 2,4,8,10,14,16 possible

• And have you found examples of each of those?
– lulu
Mar 24, 2023 at 20:34
• Examples are always key. What do you get if you take $p=5$?
– lulu
Mar 24, 2023 at 20:37
• Wouldn't $6k+2$ correspond to $18k+2/\color{red}{8/14}$? Mar 24, 2023 at 20:40
• @user2661923 By $\rm \mu LTE$: $\,p \equiv \pm1\pmod{2\cdot \color{#c00}3}\Rightarrow p^{\large \color{#c00}3}\equiv (\pm 1)^{\large \color{#c00}3}\pmod{2\cdot\color{#c00}3^2},\$ so $\,p^3+15\equiv 14,16\pmod{18}\ \$ Mar 24, 2023 at 20:54
• @BillDubuque That may have been the problem composer's point. My point was to communicate to the original poster. The communication should be shaped to the target audience. The ideas that you are broaching, are ideas that the OP may confront only after confronting the idea that he should be working in $\pmod{18}~$ rather than $~\pmod{6}. ~$ One step at a time. Mar 24, 2023 at 21:29