How should I solve the following equation:
$a(np-1)(np+1)+b p(np+1)+cp(np-1)=1$ for integers $a$,$b$ and $c$? (n and p are odd and even integers respectively and fixed.)
How should I solve the following equation:
$a(np-1)(np+1)+b p(np+1)+cp(np-1)=1$ for integers $a$,$b$ and $c$? (n and p are odd and even integers respectively and fixed.)
On
did it this morning. You say $np$ is even, so $np/2$ is an integer.
$$ a = -1; \; \; b = -n^2 p \left( \frac{np}{2} - 1 \right); \; \; c = n^2 p \left( \frac{np}{2} \right) $$
PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.
Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.
parisize = 4000000, primelimit = 500509
? x = n^2 * p^2 - 1
%1 = p^2*n^2 - 1
? y = p * (n * p + 1)
%2 = p^2*n + p
? z = p * (n * p - 1)
%3 = p^2*n - p
?
? a = -1
%4 = -1
? b = - n^2 * p * ( (n * p / 2) - 1 )
%5 = -1/2*p^2*n^3 + p*n^2
? c = n^2 * p * (n * p / 2)
%6 = 1/2*p^2*n^3
?
? a * x + b * y + c * z
%7 = 1
?
Evidently $\gcd(np+1, np-1)= 1.$ So, you can solve $$b(np+1) + c (np-1) = 1.$$ Then $\gcd((np-1)(np+1),p) = 1.$ You can solve $$ a(np-1)(np+1) + \lambda p = 1. $$ So far, you have $(a, \lambda b, \lambda c ).$
After that, other solutions are obtained by adding solutions to the homogeneous equation; these make a two dimensional integral lattice.