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”).

A130772
Periodic sequence with period 2 2 0 -2 -2 0.
7
2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2
OFFSET
0,1
COMMENTS
Sequence is identical to its third differences.
FORMULA
O.g.f.: 2/(x^2-x+1). a(n) = 2*A010892(n) . - R. J. Mathar, Feb 14 2008
a(0)=2, a(1)=2, a(n)=a(n-1)-a(n-2). - Harvey P. Dale, Jan 13 2014
a(n) = A184334(n+1) if n>=0. a(n) = A109265(n-1) = A257076(n) if n>1. - Michael Somos, Sep 01 2015
EXAMPLE
G.f. = 2 + 2*x - 2*x^3 - 2*x^4 + 2*x^6 + 2*x^7 - 2*x^9 - 2*x^10 + ...
MATHEMATICA
PadRight[{}, 120, {2, 2, 0, -2, -2, 0}] (* or *) LinearRecurrence[{1, -1}, {2, 2}, 120] (* Harvey P. Dale, Jan 13 2014 *)
PROG
(PARI) for(i=1, 9, print1("2, 2, 0, -2, -2, 0, ")) \\ Charles R Greathouse IV, Jun 02 2011
(Magma) I:=[2, 2]; [n le 2 select I[n] else Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Aug 04 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Jul 14 2007
STATUS
approved