A276599 Values of n such that n^2 + 5 is a triangular number (A000217).
1, 4, 10, 25, 59, 146, 344, 851, 2005, 4960, 11686, 28909, 68111, 168494, 396980, 982055, 2313769, 5723836, 13485634, 33360961, 78600035, 194441930, 458114576, 1133290619, 2670087421, 6605301784, 15562409950, 38498520085, 90704372279, 224385818726
Offset: 1
Examples
4 is in the sequence because 4^2 + 5 = 21, which is a triangular number.
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (0,6,0,-1).
Crossrefs
Programs
-
Magma
I:=[1,4,10,25]; [n le 4 select I[n] else 6*Self(n-2) - Self(n-4): n in [1..31]]; // G. C. Greubel, Sep 15 2021
-
Mathematica
CoefficientList[Series[(1+x)*(1+3*x+x^2)/((1+2*x-x^2)*(1-2*x-x^2)), {x, 0, 30}], x] (* Wesley Ivan Hurt, Sep 07 2016 *) LinearRecurrence[{0,6,0,-1},{1,4,10,25},30] (* Harvey P. Dale, Feb 13 2017 *)
-
PARI
Vec(x*(1+x)*(1+3*x+x^2)/((1+2*x-x^2)*(1-2*x-x^2)) + O(x^40))
-
PARI
a(n)=([0,1;-1,6]^(n\2)*if(n%2,[1;10],[-1;4]))[1,1] \\ Charles R Greathouse IV, Sep 07 2016
-
Sage
def P(n): return lucas_number1(n, 2, -1) [(1/4)*(P(n+2) + P(n+1) + (-1)^n*(3*P(n) - 7*P(n-1))) for n in (1..30)] # G. C. Greubel, Sep 15 2021
Formula
a(n) = 6*a(n-2) - a(n-4) for n>4.
G.f.: x*(1+x)*(1+3*x+x^2) / ((1+2*x-x^2)*(1-2*x-x^2)).
a(n) = (1/4)*(P(n+2) + P(n+1) + (-1)^n*(3*P(n) - 7*P(n-1))), where P(n) = A000129(n). - G. C. Greubel, Sep 15 2021