login
For k>0, a(3k+1) = k*(k-3), a(3k+2) = k*(k-1), a(3k+3) = k*(k-1)-1.
1

%I #27 Sep 08 2022 08:46:05

%S 0,0,0,-2,0,-1,-2,2,1,0,6,5,4,12,11,10,20,19,18,30,29,28,42,41,40,56,

%T 55,54,72,71,70,90,89,88,110,109,108,132,131,130,156,155,154,182,181,

%U 180,210,209,208,240,239,238,272,271,270,306,305,304,342,341

%N For k>0, a(3k+1) = k*(k-3), a(3k+2) = k*(k-1), a(3k+3) = k*(k-1)-1.

%C The first differences are 0, 0, -2, 2, -1, -1, 4, -1, -1, 6, -1, -1, 8, -1, -1, 10, ... .

%H Colin Barker, <a href="/A229204/b229204.txt">Table of n, a(n) for n = 1..1000</a>

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

%F From _Colin Barker_, Jan 12 2016: (Start)

%F a(n) = a(n-1)+2*a(n-3)-2*a(n-4)-a(n-6)+a(n-7) for n>7.

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

%F (End)

%o (Magma) &cat[IsZero(k) select [0,0,0] else [k*(k-3),k*(k-1),k*(k-1)-1]: k in [0..30]]; // _Bruno Berselli_, Sep 16 2013

%o (PARI) concat(vector(3), Vec(-x^4*(1+x^2)*(2-2*x-x^2-x^3+x^4)/((1-x)^3*(1+x+x^2)^2) + O(x^100))) \\ _Colin Barker_, Jan 12 2016

%K sign,easy

%O 1,4

%A _Ralf Stephan_, Sep 16 2013