login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A281362
a(0) = 1, a(1) = 2; for n>1, a(n) = a(n-1) + a(n-2) + floor(n/2).
4
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,2
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)
EXAMPLE
G.f. = 1 + 2*x + 4*x^2 + 7*x^3 + 13*x^4 + 22*x^5 + 38*x^6 + 63*x^7 + ...
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 *)
PROG
(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 */
(Magma) R<x>:=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
(SageMath) [2*fibonacci(n+2) -(n+2+(n%2))//2 for n in range(51)] # G. C. Greubel, Apr 05 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jan 27 2017, based on a comment in A215004 from Alex Ratushnyak, Jul 31 2012.
STATUS
approved