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.

A281362 a(0) = 1, a(1) = 2; for n>1, a(n) = a(n-1) + a(n-2) + floor(n/2).

Original entry on oeis.org

1, 2, 4, 7, 13, 22, 38, 63, 105, 172, 282, 459, 747, 1212, 1966, 3185, 5159, 8352, 13520, 21881, 35411, 57302, 92724, 150037, 242773, 392822, 635608, 1028443, 1664065, 2692522, 4356602, 7049139, 11405757, 18454912, 29860686, 48315615, 78176319, 126491952
Offset: 0

Views

Author

N. J. A. Sloane, Jan 27 2017, based on a comment in A215004 from Alex Ratushnyak, Jul 31 2012

Keywords

Examples

			G.f. = 1 + 2*x + 4*x^2 + 7*x^3 + 13*x^4 + 22*x^5 + 38*x^6 + 63*x^7 + ...
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!((1 - x^2+x^4)/((1-x)^2*(1+x)*(1-x-x^2)))); // G. C. Greubel, Jul 29 2018
    
  • Mathematica
    CoefficientList[Series[(1-x^2+x^4)/((1-x)^2*(1+x)*(1-x-x^2)), {x,0,50}], x] (* G. C. Greubel, Jul 29 2018 *)
  • PARI
    Vec((1-x^2+x^4)/((1-x)^2*(1+x)*(1-x-x^2)) + O(x^50))
    
  • PARI
    {a(n) = my(m=n); if( n<0, m=-1-n); polcoeff( (1 - x^2 + x^4) / ((1 - x - x^2 + x^3) * (1 - (-1)^(n<0)*x - x^2)) + x * O(x^m), m)}; /* Michael Somos, Jan 27 2017 */
    
  • SageMath
    [2*fibonacci(n+2) -(n+2+(n%2))//2 for n in range(51)] # G. C. Greubel, Apr 05 2024

Formula

From Colin Barker, Jan 27 2017: (Start)
a(n) = 2*a(n-1) + a(n-2) - 3*a(n-3) + a(n-5) for n>4.
G.f.: (1 - x^2 + x^4) / ((1 - x)^2*(1 + x)*(1 - x - x^2)). (End)
0 = 3 + a(n)*(-4 - 2*a(n) - a(n+1) + 6*a(n+2) - a(n+3)) + a(n+1)*(-1 + a(n+1) + a(n+2) - 2*a(n+3)) + a(n+2)*(+11 - 5*a(n+2) + 3*a(n+3)) + a(n+3)*(-6) for all n in Z. - Michael Somos, Jan 27 2017
From G. C. Greubel, Apr 05 2024: (Start)
a(n) = 2*Fibonacci(n+2) - (1/4)*(2*n + 5 - (-1)^n).
E.g.f.: (1/2)*(4*exp(x/2)*(cosh(sqrt(5)*x/2) + (3/sqrt(5))*sinh( sqrt(5)*x/2)) - (x+2)*cosh(x) - (x+3)*sinh(x)). (End)