0
$\begingroup$

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[[1]]^2 + n*ve[[2]]^2 - m

(* 0 *)

Is this a bug in WA or Mathematica?

$\endgroup$

2 Answers 2

3
$\begingroup$

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}}    *)
$\endgroup$
2
  • $\begingroup$ Thanks. Can I make it work in WA? $\endgroup$
    – joro
    Commented Jul 2, 2019 at 15:09
  • 2
    $\begingroup$ This site is about Mathematica, not Wolfram Alpha. $\endgroup$
    – Roman
    Commented Jul 2, 2019 at 15:20
4
$\begingroup$

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 *)

Using FindInstance

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"]

enter image description here

$\endgroup$

Your Answer

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

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