OFFSET
1,1
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
G.f.: -x*(28-57*x+27*x^2+8*x^6-11*x^7+3*x^9)/(1-x)^3.
a(n) = n^2 - 4*n - 24 for n > 7. - Charles R Greathouse IV, May 26 2026
EXAMPLE
For k = -19, k^3+28*k^2 = -6859+10108 = 3249 = 57^2 is a square.
For k = 0, k^3+28*k^2 = 0^3+28*0^2 = 0 = 0^2 is a square.
For k = 21; k^3+28*k^2 = 9261+12348 = 21609 = 147^2 is a square.
MATHEMATICA
CoefficientList[Series[-(28-57*x+27*x^2+8*x^6-11*x^7+3*x^9)/(1-x)^3, {x, 0, 60}], x] (* Vincenzo Librandi, Feb 22 2012 *)
(* Alternative: *)
Select[Range[-30, 2500], IntegerQ[Sqrt[#^3+28#^2]]&] (* or *) LinearRecurrence[ {3, -3, 1}, {-28, -27, -24, -19, -12, -3, 0, 8, 21, 36}, 60] (* Harvey P. Dale, Jan 10 2023 *)
PROG
(Magma) [ n: n in [ -30..2400] | IsSquare(n^3+28*n^2) ];
(PARI) a(n)=if(n>7, n^2-4*n-24, [-28, -27, -24, -19, -12, -3, 0][n]) \\ Charles R Greathouse IV, May 26 2026
(PARI) is(n) = issquare(28+n) || n == 0 \\ David A. Corneth, May 26 2026
CROSSREFS
KEYWORD
sign,easy,changed
AUTHOR
Klaus Brockhaus, Jan 21 2009
STATUS
approved
