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.

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

This page as a plain text file.
%I A215004 #65 Oct 01 2024 15:45:06
%S A215004 1,1,3,5,10,17,30,50,84,138,227,370,603,979,1589,2575,4172,6755,10936,
%T A215004 17700,28646,46356,75013,121380,196405,317797,514215,832025,1346254,
%U A215004 2178293,3524562,5702870,9227448,14930334,24157799,39088150,63245967,102334135,165580121
%N A215004 a(0) = a(1) = 1; for n>1, a(n) = a(n-1) + a(n-2) + floor(n/2).
%C A215004 If the first two terms are {0,1}, we get A020956 except for the first term.
%C A215004 If the first two terms are {1,2}, we get A281362.
%H A215004 Colin Barker, <a href="/A215004/b215004.txt">Table of n, a(n) for n = 0..1000</a>
%H A215004 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 A215004 Nathan Fox, <a href="/A280523/a280523.pdf">Proof of formula for a(n)</a>.
%H A215004 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-3,0,1).
%F A215004 From _Colin Barker_, Sep 16 2015: (Start)
%F A215004 a(n) = 2*a(n-1) + a(n-2) - 3*a(n-3) + a(n-5) for n>4.
%F A215004 G.f.: (1-x+x^3) / ((1-x)^2*(1+x)*(1-x-x^2)). (End)
%F A215004 a(n) = Fibonacci(n+3) - floor((n+3)/2). - _Nathan Fox_, Jan 27 2017
%F A215004 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 A215004 From _G. C. Greubel_, Apr 05 2024: (Start)
%F A215004 a(n) =  Fibonacci(n+3) - (1/4)*(2*n + 5 - (-1)^n).
%F A215004 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 A215004 Table[((-1)^n - 2 n + 8 Fibonacci[n] + 4 LucasL[n] - 5)/4, {n, 0, 20}] (* _Vladimir Reshetnikov_, May 18 2016 *)
%t A215004 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 A215004 (Python)
%o A215004 prpr = prev = 1
%o A215004 for n in range(2,100):
%o A215004     print(prpr, end=', ')
%o A215004     curr = prpr+prev + n//2
%o A215004     prpr = prev
%o A215004     prev = curr
%o A215004 (PARI) Vec(-(x^3-x+1)/((x-1)^2*(x+1)*(x^2+x-1)) + O(x^100)) \\ _Colin Barker_, Sep 16 2015
%o A215004 (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 A215004 (Magma) [Fibonacci(n+3)-(2*n+5-(-1)^n)/4: n in [0..40]]; // _G. C. Greubel, Feb 01 2018
%o A215004 (SageMath) [fibonacci(n+3) -(n+2+(n%2))//2 for n in range(41)] # _G. C. Greubel_, Apr 05 2024
%Y A215004 Cf. A020956, except for first term: same formula, seed {0,1}.
%Y A215004 Cf. A000045, A281362.
%K A215004 nonn,easy
%O A215004 0,3
%A A215004 _Alex Ratushnyak_, Jul 31 2012