#6) more diophantine equations
\(\text{Let the number of candies in the box = }N\\ N-3 \pmod{7}=0\\ N-6 \pmod{8} = 0\\ N+3 \pmod{5} = 0\)
\(N \pmod{7}=3,~N\pmod{8}=6\\ 7m+3 = 8n+6\\ m = \dfrac{8n+3}{7}\in \mathbb{Z}\\ 8n+3 \pmod{7}=0\\ n \pmod{7}=4\)
\(N=8(7k+4)+6 = 56k+38\\ 56k+38+3\pmod{5}=0\\ k + 1\pmod{5} = 0\\ k \pmod{5} = 4\\ N=56(5j+4)+38 = 280j+262\)
\(\text{we can't have negative candies so the smallest }N\\ \text{occurs when }j=0 \text{ i.e. when }N=262\)
.