Writing a complicated statement with quantifiers.

35 Views Asked by At

I'm having a hard time formulating the following statement symbolically with quantifiers:

Let $d\in\mathbb{N}$ and $p,q\in\mathbb{P}$ with $p\neq q$. Then there is a natural number $k<q$ such that $q\mid (p+kd)$ if and only if $q\nmid d$.

So far my best idea is:

$$(\forall d\in\mathbb{N}) (\forall p,q\in\mathbb{P}) (\exists k\in\mathbb{N}) (p\neq q\implies ([(k<q)\land (q\mid(p+kd))]\iff q\nmid d))$$

But that looks pretty fishy to me. Any tips would be greatly appreciated!

Edit: what about:

$$(\forall d\in\mathbb{N}) (\forall p,q\in\mathbb{P}) (p\neq q\implies [q\nmid d \iff (\exists k\in\mathbb{N})(k<q\land q\mid p+kd)])$$

??? Maybe I was just overthinking it (and suck at quantifiers)