# Mind your p's and q's cubed

Number Theory Level 5

Find the sum of all primes $$q<1000$$ such that for some prime $$p<q$$, both $$q$$ divides $$p^3-1$$ and $$p$$ divides $$q^3-1$$.

×