[seqfan] A024359 Consider primitive Pythagorean triangles

VladimirJosephStephanOrlovsky Orlovsky 4vladimir at gmail.com
Tue Dec 3 02:06:16 CET 2013


Error in Mathematica Program

Currently:

solns[a_] := Module[{b, c, soln}, soln = Reduce[a^2 + b^2 == c^2 && a < b
&& c > 0 && GCD[a, b, c] == 1, {b, c}, Integers]; If[soln === False, 0,
If[soln[[1, 1]] === b, 1, Length[soln]]]]; Table[solns[n], {n 100}]


Expected:

solns[a_] := Module[{b, c, soln}, soln = Reduce[a^2 + b^2 == c^2 && a < b
&& c > 0 && GCD[a, b, c] == 1, {b, c}, Integers]; If[soln === False, 0,
If[soln[[1, 1]] === b, 1, Length[soln]]]]; Table[solns[n], {n, 100}]



-Vladimir.Joseph.Stephan.Orlovsky


More information about the SeqFan mailing list