(* You should be able to copy and paste this text file directly into Mathematica. These notes will be interpreted as commented code. *) (* ********* Here are some useful commands for finding points on elliptic curves ******** *) FindInstance[y^2 == x^3 - 43 x + 166, {x,y}, Integers] (* This attempts to find an integral solution to y^2 == x^3 - 43 x + 166 *) FindInstance[y^2 == x^3 - 43 x + 166, {x,y}, Integers, 5] (* This attempts to find five integral solutions to y^2 == x^3 - 43 x + 166 *) (* *** Note on FindInstance: Mathematica usually doesn't do a brute-force search, so it will sometimes be unable to find solutions even if there are small ones. To force it to do an explicit search, you can include a range of values for one of the variables *) FindInstance[y^2 == x^3 - 43 x + 166 && -100 <= x <= 100, {x,y}, Integers, 5] (* This attempts to find five integral solutions to y^2 == x^3 - 43 x + 166 with -100 <= x <= 100 *) (* You can also use Reduce to find solutions when you include a range *) Reduce[y^2 == x^3 - 43 x + 166 && -100 <= x <= 100, {x,y}, Integers] (* Reduce will find all of the solutions in the given range *) (* ***** Here are some useful other commands for problem 1 ****** *) ellcurvedisc[f_] := -16 * Discriminant[f,x] ellcurvedisc[x^3 + x^2 - x + 7] (* Computes the discriminant of the elliptic curve y^2 = f(x) in general Weierstrass form *) (* ***** Here are some useful other commands for problem 3 ****** *) poly3a[A_,B_] := 12x(x^3 + A x + B) - (3x^2 + A)^2 poly3c[A_,B_] := 12x(3x^2 + A)(x^3 + A x + B) - (3x^2 + A)^3 - 8(x^3 + A x + B)^2 (* These are the two polynomials in the problem *) (* ***** Here are some useful other commands for problem 4 ***** *) (* even n *) nval = 34; Reduce[4 x^2 + y^2 + 32 z^2 == nval/2, Integers] Reduce[4 x^2 + y^2 + 8 z^2 == nval/2, Integers] (* odd n *) nval = 13; Reduce[2 x^2 + y^2 + 32 z^2 == nval, Integers] Reduce[2 x^2 + y^2 + 8 z^2 == nval, Integers] (* Computes the solutions to the equations needed for Tunnell's theorem *) nval = 5; FindInstance[y^2 == x^3 - nval^2 * x && y != 0, {x,y}, Integers] (* Searches for an integral point on the congruent-number curve for the given value of n *) (* As above, you may wish to include a search range for x to force Mathematica to search exhaustively *)