login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A261557 a(0) = a(1) = 0; for n>1, a(n) = 2*n - a(n-1) - a(n-2). 1
0, 0, 4, 2, 2, 6, 4, 4, 8, 6, 6, 10, 8, 8, 12, 10, 10, 14, 12, 12, 16, 14, 14, 18, 16, 16, 20, 18, 18, 22, 20, 20, 24, 22, 22, 26, 24, 24, 28, 26, 26, 30, 28, 28, 32, 30, 30, 34, 32, 32, 36, 34, 34, 38, 36, 36, 40, 38, 38, 42, 40, 40, 44, 42 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

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

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

FORMULA

From Colin Barker, Nov 19 2015: (Start)

a(n) = a(n-3) + 2 for n>2.

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

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

a(n) = (2/3)*(1 + n - (1 + n mod 3)*(-1)^(-n mod 3)). [Bruno Berselli, Nov 19 2015]

a(n) = (2/9)*(3*n+3+9*cos(2*(n-2)*Pi/3)+sqrt(3)*sin(2*(n-2)*Pi/3)). - Wesley Ivan Hurt, Oct 01 2017

MATHEMATICA

RecurrenceTable[{a[0] == a[1] == 0, a[n] == 2 n - a[n - 1] - a[n - 2]}, a, {n, 0, 70}] (* Bruno Berselli, Nov 19 2015 *)

PROG

(PARI) a(n)=if(n<2, 0, 2*n-a(n-1)-a(n-2))

(PARI) first(m)=my(v=vector(m)); v[1]=0; v[2]=0; for(i=3, m, v[i]=2*(i-1)-v[i-1]-v[i-2]); v

(PARI) concat(vector(2), Vec(-2*x^2*(x-2)/((x-1)^2*(x^2+x+1)) + O(x^100))) \\ Colin Barker, Nov 19 2015

(MAGMA) [(2/3)*(1+n-(1+n mod 3)*(-1)^(-n mod 3)): n in [0..70]]; // Bruno Berselli, Nov 19 2015

CROSSREFS

Sequence in context: A199609 A284692 A019834 * A270809 A087507 A020777

Adjacent sequences:  A261554 A261555 A261556 * A261558 A261559 A261560

KEYWORD

nonn,easy

AUTHOR

Anders Hellström, Nov 18 2015

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 July 22 20:51 EDT 2019. Contains 325226 sequences. (Running on oeis4.)