OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,108,-108,-982,982,108,-108,-1,1).
FORMULA
From Colin Barker, Sep 24 2018: (Start) Heinz's formula implies a g.f. and a recurrence:
G.f.: x^2*(15 + 90*x + 291*x^2 - 108*x^3 - 83*x^4 + 2*x^5 + x^6) / ((1 - x)*(1 - 10*x + x^2)*(1 + 10*x + x^2)*(1 - 10*x^2 + x^4)).
a(n) = a(n-1) + 108*a(n-2) - 108*a(n-3) - 982*a(n-4) + 982*a(n-5) + 108*a(n-6) - 108*a(n-7) - a(n-8) + a(n-9) for n>9.
(End)
MATHEMATICA
Select[Partition[Accumulate[Range[2500000]], 3, 1], IntegerQ[Sqrt[ Total[ #]]]&] [[All, 1]]
(#(#+1))/2&/@LinearRecurrence[{1, 10, -10, -1, 1}, {0, 5, 14, 63, 152}, 20]
LinearRecurrence[{1, 108, -108, -982, 982, 108, -108, -1, 1}, {0, 15, 105, 2016, 11628, 203203, 1152921, 19968040, 113108320}, 20] (* Ray Chandler, Mar 01 2024 *)
PROG
(PARI) concat(0, Vec(x^2*(15 + 90*x + 291*x^2 - 108*x^3 - 83*x^4 + 2*x^5 + x^6) / ((1 - x)*(1 - 10*x + x^2)*(1 + 10*x + x^2)*(1 - 10*x^2 + x^4)) + O(x^40))) \\ Colin Barker, Sep 24 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Harvey P. Dale, Sep 23 2018
STATUS
approved