Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For what values of $q$ would $3n - q^2 \equiv 0\pmod{4q}$, or for what values of $q$ would $3n - q^2$ divide by $4q$ and leave no remainder, where $n$ is a positive integer and $q$ is a positive divisor of $n$.

share|cite|improve this question
up vote 3 down vote accepted

If $n = q k$, $3n - q^2 = (3k - q) q$. So you need $3k - q$ to be divisible by $4$, i.e. $q \equiv -k \mod 4$. Now since $q k = n$, that says $n \equiv -q^2 \mod 4$. The squares mod $4$ are $0$ and $1$, so we have the following possibilities:

  • if $n \equiv 1$ or $2 \mod 4$, it is impossible
  • if $n \equiv 0 \mod 4$, $q \equiv n/q \equiv 0$ or $2 \mod 4$ (thus either $n \equiv 0 \mod 16$ or $n \equiv 4 \mod 8$).
  • if $n \equiv 3 \mod 4$, it is true for any $q$ dividing $n$.
share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.