cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A276599 Values of n such that n^2 + 5 is a triangular number (A000217).

Original entry on oeis.org

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

Views

Author

Colin Barker, Sep 07 2016

Keywords

Examples

			4 is in the sequence because 4^2 + 5 = 21, which is a triangular number.
		

Crossrefs

Cf. A001109 (k=0), A106328 (k=1), A077241 (k=2), A276598 (k=3), A276600 (k=6), A276601 (k=9), A276602 (k=10), where k is the value added to n^2.

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