login
a(0) = 1, a(1) = 2, a(3) = 3, a(n) = a(n-1) - a(n-3).
0

%I #20 Jun 09 2020 03:07:16

%S 1,2,3,2,0,-3,-5,-5,-2,3,8,10,7,-1,-11,-18,-17,-6,12,29,35,23,-6,-41,

%T -64,-58,-17,47,105,122,75,-30,-152,-227,-197,-45,182,379,424,242,

%U -137,-561,-803,-666,-105,698,1364,1469,771,-593,-2062,-2833,-2240,-178

%N a(0) = 1, a(1) = 2, a(3) = 3, a(n) = a(n-1) - a(n-3).

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,-1).

%F a(n) = (-1)^n*A104771(n).

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

%e a(3) = 2 because 2 = 3 - 1 where the 1, 3 on the right of the equals sign are the first and third terms of the series.

%t LinearRecurrence[{1,0,-1},{1,2,3},80] (* _Harvey P. Dale_, Apr 13 2012 *)

%o (Python)

%o series = [1, 2, 3]

%o for i in range(2, 30):

%o series.append(series[i] - series[i - 2])

%o print(series)

%Y Cf. A104771

%K easy,sign

%O 0,2

%A _Ben Paul Thurston_, Sep 06 2009

%E Offset corrected and recurrence simplified by _R. J. Mathar_, Sep 08 2009

%E More terms from _Harvey P. Dale_, Apr 13 2012