# Wolfram Alpha missing solutions to a quadratic equation over the integers?

I don't have Mathematica, but Wolfram Alpha appears to miss integer solutions to bivariate quadratic equation:

solve over integers X^2 + 1672739 Y^2 = 4680419795530281540

returns only two pairs of solutions and there is at least one other solution:

n=1672739; m=4680419795530281540;
ve = {1279600926, -1348776};
ve[]^2 + n*ve[]^2 - m

(* 0 *)


Is this a bug in WA or Mathematica?

Works fine in Mathematica:

Solve[X^2 + 1672739 Y^2 == 4680419795530281540, {X, Y}, NonNegativeIntegers]

(*    {{X -> 1672739, Y -> 1672739},
{X -> 1279600926, Y -> 1348776},
{X -> 1793487071, Y -> 935471}}    *)

• Thanks. Can I make it work in WA? – joro Jul 2 '19 at 15:09
• This site is about Mathematica, not Wolfram Alpha. – Roman Jul 2 '19 at 15:20

This site is about Mathematica not WolframAlpha. Mathematica finds 12 solutions.

eqn = X^2 + 1672739 Y^2 == 4680419795530281540;


Using Solve

sol = Solve[eqn, {X, Y}, Integers]

(* {{X -> -1793487071, Y -> -935471}, {X -> -1793487071,
Y -> 935471}, {X -> -1279600926, Y -> -1348776}, {X -> -1279600926,
Y -> 1348776}, {X -> -1672739, Y -> -1672739}, {X -> -1672739,
Y -> 1672739}, {X -> 1672739, Y -> -1672739}, {X -> 1672739,
Y -> 1672739}, {X -> 1279600926, Y -> -1348776}, {X -> 1279600926,
Y -> 1348776}, {X -> 1793487071, Y -> -935471}, {X -> 1793487071,
Y -> 935471}} *)

Length@sol

(* 12 *)


Verifying the solution

And @@ (eqn /. sol)

(* True *)


Using Reduce

sol2 = {Reduce[eqn, {X, Y}, Integers] // ToRules}

(* {{X -> -1793487071, Y -> -935471}, {X -> -1793487071,
Y -> 935471}, {X -> -1279600926, Y -> -1348776}, {X -> -1279600926,
Y -> 1348776}, {X -> -1672739, Y -> -1672739}, {X -> -1672739,
Y -> 1672739}, {X -> 1672739, Y -> -1672739}, {X -> 1672739,
Y -> 1672739}, {X -> 1279600926, Y -> -1348776}, {X -> 1279600926,
Y -> 1348776}, {X -> 1793487071, Y -> -935471}, {X -> 1793487071,
Y -> 935471}} *)


The results are identical:

sol === sol2

(* True *)

sol3 = FindInstance[eqn, {X, Y}, Integers, 20]

(* {{X -> -1793487071, Y -> -935471}, {X -> -1793487071,
Y -> 935471}, {X -> -1279600926, Y -> -1348776}, {X -> -1279600926,
Y -> 1348776}, {X -> -1672739, Y -> -1672739}, {X -> -1672739,
Y -> 1672739}, {X -> 1672739, Y -> -1672739}, {X -> 1672739,
Y -> 1672739}, {X -> 1279600926, Y -> -1348776}, {X -> 1279600926,
Y -> 1348776}, {X -> 1793487071, Y -> -935471}, {X -> 1793487071,
Y -> 935471}} *)


The results are identical:

sol === sol3

(* True *)


EDIT: WolframAlpha finds the three underlying solutions (each has four sign variations) if you restrict it to positive integers.

WolframAlpha["Solve over positive integers X^2+1672739
Y^2 = 4680419795530281540"] 