0
$\begingroup$

I am working on a problem that I need a simple method of identifying whether a positive integer $n$ can be expressed as \begin{equation*} n=4p^2q^2-(p+q)^2 \end{equation*} or \begin{equation*} n=4p^2q^2-(p-q)^2 \end{equation*} in which $p,q$ are positive integers. Do integers of these forms have any special characters?

One obvious thing is that $n\equiv 0,3 \mod 4$ to qualify either of them. Anything more than that?

$\endgroup$
1
  • $\begingroup$ sorry Pietro, should be positive integers $\endgroup$ May 21, 2018 at 11:30

2 Answers 2

2
$\begingroup$

It can be seen that both forms can be factored as differences of squares. Correspondingly, $n$ can be expressed in these forms iff there exists a divisor $d\mid n$ such that $d$ and $\frac{n}{d}$ have the same parity, and $$(\star)\qquad \left(\frac{n}{d}-d\right)^2 \mp 4\left(\frac{n}{d}+d\right)$$ is a square (where the "$-$" sign corresponds to the former form, while the "$+$" sign corresponds to the latter one).

To test this condition, one can iterate $d$ over the divisors of $n$ if $n$ is odd, and over the twice the divisors of $\frac{n}{4}$ if $n$ is a multiple of 4, and check if $(\star)$ is a square.

$\endgroup$
0
0
$\begingroup$

To be more precise,

$4|n$ or $n\equiv 7\mod 8$

since the square of an odd number is congruent to 1 mod 8.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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