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”).
%I #10 Oct 27 2023 09:02:44
%S 0,0,1,3,6,11,21,42,63,105,210,441,903,1806,2709,4515,9030,18963,
%T 38829,77658,116487,194145,388290,815409,1669647,3339294,5008941,
%U 8348235,16696470,35062587,71794821,143589642,215384463,358974105,717948210
%N a(6n+k) = 3a(6n+k-1)-3a(6n+k-2)+2a(6n+k-3), k = 0, 1, 3, 4, 5; a(6n+2) = 3a(6n+1)-3a(6n). a(0) = a(1) = 0, a(2) = 1.
%C The third differences are 0, 0, 1, 3, 6, -11, 21, 42, 63, 105, 210, -441, ..., equal to the original sequence if each 6th term is negated.
%p A132658 := proc(n)
%p option remember;
%p if n <=1 then
%p 0;
%p elif n = 2 then
%p 1;
%p elif modp(n,6) = 2 then
%p 3*procname(n-1)-3*procname(n-2);
%p else
%p 3*procname(n-1)-3*procname(n-2)+2*procname(n-3) ;
%p end if;
%p end proc:
%p seq(A132658(n),n=0..80) ; # _R. J. Mathar_, Aug 07 2017
%t a[n_] := a[n] = Which[n <= 1, 0, n == 2, 1, Mod[n, 6] == 2, 3a[n-1] - 3a[n-2], True, 3a[n-1] - 3a[n-2] + 2a[n-3]];
%t Table[a[n], {n, 0, 80}] (+ _Jean-François Alcover_, Oct 27 2023, after _R. J. Mathar_ *)
%Y Cf. A024495.
%K nonn
%O 0,4
%A _Paul Curtz_, Nov 15 2007
%E Edited by _R. J. Mathar_, Jul 07 2008