%I #16 Sep 08 2022 08:45:31
%S -4,-3,-1,0,1,3,5,11,15,28,47,55,81,549,1799,8361
%N Integers n such that n^3 + n^2 - 9*n + 16 is a square.
%C The set of x values of integral points on the elliptic curve y^2 = x^3 + x^2 - 9*x + 16.
%e 0^3 + (-5)^2 + (-9) = 4^2, 1^3 + (-4)^2 + (-8) = 3^2, 3^3 + (-2)^2 + (-6) = 5^2
%t ok[x_] := Reduce[{y^2 == x^3 + x^2 - 9*x + 16, y >= 0}, y, Integers] =!= False; Select[Table[x, {x, -4, 10000}], ok ] (* _Jean-François Alcover_, Sep 07 2011 *)
%o (Magma) P<n> := PolynomialRing(Integers()); {x: x in Sort([ p[1] : p in IntegralPoints(EllipticCurve(n^3 + n^2 - 9*n + 16)) ])};
%o (Sage) EllipticCurve([0,1,0,-9,16]).integral_points()
%o (PARI) is(n)=issquare(n^3+n^2-9*n+16) \\ _Charles R Greathouse IV_, Sep 06 2016
%Y Cf. A117950, A132411, A132414, A002522, A028872.
%K sign,full,fini
%O 1,1
%A _Mohamed Bouhamida_, Nov 29 2007
%E Edited by _Max Alekseyev_, Nov 13 2009
|