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”).
%I #65 Oct 01 2024 15:45:06
%S 1,1,3,5,10,17,30,50,84,138,227,370,603,979,1589,2575,4172,6755,10936,
%T 17700,28646,46356,75013,121380,196405,317797,514215,832025,1346254,
%U 2178293,3524562,5702870,9227448,14930334,24157799,39088150,63245967,102334135,165580121
%N a(0) = a(1) = 1; for n>1, a(n) = a(n-1) + a(n-2) + floor(n/2).
%C If the first two terms are {0,1}, we get A020956 except for the first term.
%C If the first two terms are {1,2}, we get A281362.
%H Colin Barker, <a href="/A215004/b215004.txt">Table of n, a(n) for n = 0..1000</a>
%H Jean-Luc Baril, Sergey Kirgizov, and Armen Petrossian, <a href="https://ajc.maths.uq.edu.au/pdf/84/ajc_v84_p398.pdf">Dyck Paths with catastrophes modulo the positions of a given pattern</a>, Australasian J. Comb. (2022) Vol. 84, No. 2, 398-418.
%H Nathan Fox, <a href="/A280523/a280523.pdf">Proof of formula for a(n)</a>.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-3,0,1).
%F From _Colin Barker_, Sep 16 2015: (Start)
%F a(n) = 2*a(n-1) + a(n-2) - 3*a(n-3) + a(n-5) for n>4.
%F G.f.: (1-x+x^3) / ((1-x)^2*(1+x)*(1-x-x^2)). (End)
%F a(n) = Fibonacci(n+3) - floor((n+3)/2). - _Nathan Fox_, Jan 27 2017
%F a(n) = (-3/4 + (-1)^n/4 + (2^(-n)*((1-t)^n*(-2+t) + (1+t)^n*(2+t)))/t + (-1-n)/2) where t=sqrt(5). - _Colin Barker_, Feb 09 2017
%F From _G. C. Greubel_, Apr 05 2024: (Start)
%F a(n) = Fibonacci(n+3) - (1/4)*(2*n + 5 - (-1)^n).
%F E.g.f.: 2*exp(x/2)*( cosh(sqrt(5)*x/2) + (2/sqrt(5))*sinh(sqrt(5)*x/2) ) - (1/2)*( (x+2)*cosh(x) + (x+3)*sinh(x) ). (End)
%t Table[((-1)^n - 2 n + 8 Fibonacci[n] + 4 LucasL[n] - 5)/4, {n, 0, 20}] (* _Vladimir Reshetnikov_, May 18 2016 *)
%t RecurrenceTable[{a[0]==a[1]==1,a[n]==a[n-1]+a[n-2]+Floor[n/2]},a,{n,40}] (* or *) LinearRecurrence[{2,1,-3,0,1},{1,1,3,5,10},40] (* _Harvey P. Dale_, Jul 11 2020 *)
%o (Python)
%o prpr = prev = 1
%o for n in range(2,100):
%o print(prpr, end=', ')
%o curr = prpr+prev + n//2
%o prpr = prev
%o prev = curr
%o (PARI) Vec(-(x^3-x+1)/((x-1)^2*(x+1)*(x^2+x-1)) + O(x^100)) \\ _Colin Barker_, Sep 16 2015
%o (PARI) a(n)=([0,1,0,0,0;0,0,1,0,0;0,0,0,1,0;0,0,0,0,1;1,0,-3,1,2]^n* [1;1;3;5;10])[1,1] \\ _Charles R Greathouse IV_, Jan 16 2017
%o (Magma) [Fibonacci(n+3)-(2*n+5-(-1)^n)/4: n in [0..40]]; // _G. C. Greubel, Feb 01 2018
%o (SageMath) [fibonacci(n+3) -(n+2+(n%2))//2 for n in range(41)] # _G. C. Greubel_, Apr 05 2024
%Y Cf. A020956, except for first term: same formula, seed {0,1}.
%Y Cf. A000045, A281362.
%K nonn,easy
%O 0,3
%A _Alex Ratushnyak_, Jul 31 2012