%I #28 Dec 12 2023 09:29:41
%S 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,
%T 0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2
%N Periodic sequence with period 2 2 0 -2 -2 0.
%C Sequence is identical to its third differences.
%H G. C. Greubel, <a href="/A130772/b130772.txt">Table of n, a(n) for n = 0..2500</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1).
%F O.g.f.: 2/(x^2-x+1). a(n) = 2*A010892(n) . - _R. J. Mathar_, Feb 14 2008
%F a(0)=2, a(1)=2, a(n)=a(n-1)-a(n-2). - _Harvey P. Dale_, Jan 13 2014
%F a(n) = A184334(n+1) if n>=0. a(n) = A109265(n-1) = A257076(n) if n>1. - _Michael Somos_, Sep 01 2015
%e G.f. = 2 + 2*x - 2*x^3 - 2*x^4 + 2*x^6 + 2*x^7 - 2*x^9 - 2*x^10 + ...
%t PadRight[{},120,{2,2,0,-2,-2,0}] (* or *) LinearRecurrence[{1,-1},{2,2},120] (* _Harvey P. Dale_, Jan 13 2014 *)
%o (PARI) for(i=1,9,print1("2, 2, 0, -2, -2, 0, ")) \\ _Charles R Greathouse IV_, Jun 02 2011
%o (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
%Y Cf. A010892, A109265, A184334, A257076.
%K sign,easy
%O 0,1
%A _Paul Curtz_, Jul 14 2007
|