login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215004 a(0) = a(1) = 1; for n>1, a(n) = a(n-1) + a(n-2) + floor(n/2). 3
1, 1, 3, 5, 10, 17, 30, 50, 84, 138, 227, 370, 603, 979, 1589, 2575, 4172, 6755, 10936, 17700, 28646, 46356, 75013, 121380, 196405, 317797, 514215, 832025, 1346254, 2178293, 3524562, 5702870, 9227448, 14930334, 24157799, 39088150, 63245967, 102334135, 165580121 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

If the first two terms are {0,1}, we get A020956 except for the first term.

If the first two terms are {1,2}, we get A281362.

LINKS

Colin Barker, Table of n, a(n) for n = 0..1000

Nathan Fox, Proof of formula for a(n).

Index entries for linear recurrences with constant coefficients, signature (2,1,-3,0,1).

FORMULA

From Colin Barker, Sep 16 2015: (Start)

a(n) = 2*a(n-1) + a(n-2) - 3*a(n-3) + a(n-5) for n>4.

G.f.: -(x^3-x+1) / ((x-1)^2*(x+1)*(x^2+x-1)).

(End)

a(n) = Fibonacci(n+3) - floor((n+3)/2). - Nathan Fox, Jan 27 2017

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

MATHEMATICA

Table[((-1)^n - 2 n + 8 Fibonacci[n] + 4 LucasL[n] - 5)/4, {n, 0, 20}] (* Vladimir Reshetnikov, May 18 2016 *)

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 *)

PROG

(Python)

prpr = prev = 1

for n in range(2, 100):

    print prpr,

    curr = prpr+prev + n//2

    prpr = prev

    prev = curr

(PARI) Vec(-(x^3-x+1)/((x-1)^2*(x+1)*(x^2+x-1)) + O(x^100)) \\ Colin Barker, Sep 16 2015

(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

(MAGMA) [((-1)^n-2*n+8*Fibonacci(n)+4*Lucas(n)-5)/4: n in [0..30]]; // _G. C. Greubel, Feb 01 2018

CROSSREFS

Cf. A020956, except for first term: same formula, seed {0,1}.

Cf. also A000045, A281362.

Sequence in context: A270415 A192757 A079934 * A005403 A018072 A090170

Adjacent sequences:  A215001 A215002 A215003 * A215005 A215006 A215007

KEYWORD

nonn,easy

AUTHOR

Alex Ratushnyak, Jul 31 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 18 04:47 EST 2021. Contains 340250 sequences. (Running on oeis4.)