%I #70 May 10 2023 11:58:32
%S 1,1,1,0,-3,-9,-18,-27,-27,0,81,243,486,729,729,0,-2187,-6561,-13122,
%T -19683,-19683,0,59049,177147,354294,531441,531441,0,-1594323,
%U -4782969,-9565938,-14348907,-14348907,0,43046721,129140163,258280326,387420489,387420489
%N a(n) = Sum_{j=0..floor(n/3)} (-1)^j*binomial(n,3*j).
%C Let M be any endomorphism on any vector space, such that M^3 = 1 (identity). Then (1-M)^n = a(n)-A057682(n)*M+z(n)*M^2, where z(0)=z(1)=0 and, apparently, z(n+2)=A057083(n). - _Stanislav Sykora_, Jun 10 2012
%C Pisano period lengths: 1, 3, 1, 6, 24, 3, 6, 12, 1, 24, 60, 6, 12, 6, 24, 24, 96, 3, 18, 24, ... . - _R. J. Mathar_, Aug 10 2012
%C {A057681, A057682, A*}, where A* is A057083 prefixed by two 0's, is the difference analog of the trigonometric functions of order 3, {k_1(x), k_2(x), k_3(x)}. For a definition see [Erdelyi] and the Shevelev link. - _Vladimir Shevelev_, Jun 25 2017
%D A. Erdelyi, Higher Transcendental Functions, McGraw-Hill, 1955, Vol. 3, Chapter XVIII.
%H G. C. Greubel, <a href="/A057681/b057681.txt">Table of n, a(n) for n = 0..1000</a>
%H T. Alden Gassert, <a href="http://arxiv.org/abs/1409.7829">Discriminants of simplest 3^n-tic extensions</a>, arXiv:1409.7829 [math.NT], 2014.
%H Mark W. Coffey, <a href="http://arxiv.org/abs/1506.09160">Reductions of particular hypergeometric functions 3F2 (a, a+1/3, a+2/3; p/3, q/3; +-1)</a>, arXiv:1506.09160 [math.CA], 2015.
%H John B. Dobson, <a href="http://arxiv.org/abs/1610.09361">A matrix variation on Ramus's identity for lacunary sums of binomial coefficients</a>, arXiv:1610.09361 [math.NT], 2016.
%H Ira Gessel, <a href="http://www.cs.brandeis.edu/~ira/">The Smith College diploma problem</a>.
%H Vladimir Shevelev, <a href="https://arxiv.org/abs/1706.01454">Combinatorial identities generated by difference analogs of hyperbolic and trigonometric functions of order n</a>, arXiv:1706.01454 [math.CO], 2017.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3).
%F From _Paul Barry_, Feb 26 2004: (Start)
%F G.f.: (1-x)^2/((1-x)^3+x^3).
%F a(n) = 0^n/3 + 2*3^((n-2)/2)*cos(Pi*n/6). (End)
%F From _Paul Barry_, Feb 27 2004: (Start)
%F Binomial transform of (1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 0, ...).
%F E.g.f.: 2*exp(3x/2)*cos(sqrt(3)*x/2)/3+1/3.
%F a(n) = (((3+sqrt(-3))/2)^n+((3-sqrt(-3))/2)^n)/3+0^n/3. (End)
%F a(n) = 6*a(n-1)-15*a(n-2)+20*a(n-3)-15*a(n-4)+6*a(n-5). - _Paul Curtz_, Jan 02 2008
%F Start with x(0)=1,y(0)=0,z(0)=0 and set x(n+1)=x(n)-z(n), y(n+1)=y(n)-x(n),z(n+1)=z(n)-y(n). Then a(n)=x(n). But this recurrence falls into a repetitive cycle of length 6 and multiplicative factor -27, so that a(n) = -27*a(n-6) for any n>6. - _Stanislav Sykora_, Jun 10 2012
%F E.g.f.: (1+2*exp(3*z/2)*cos(z*sqrt(3/4)))/3. - _Peter Luschny_, Jul 10 2012
%F a(0)=a(1)=a(2)=1, a(n)=3*a(n-1)-3*a(n-2), n>=3. - _Wesley Ivan Hurt_, Nov 11 2014
%F For n>=1, a(n) = 2*3^((n-2)/2)*cos(Pi*n/6). - _Vladimir Shevelev_, Jun 25 2017
%F a(n+m) = a(n)*a(m)-A057682(n)*A*057083(m)-A*057083(n)*A057682(m), where A*057083 is A057083 prefixed by two 0's. - _Vladimir Shevelev_, Jun 25 2017
%e If M^3=1 then (1-M)^6 = a(6)-A057682(6)*M+A057083(4)*M^2 = -18+9*M+9*M^2.
%p A057681 := n->add((-1)^j*binomial(n,3*j),j=0..floor(n/3)); seq(A057681(n), n=0..50);
%p A057681_list := proc(n) local i; series((1+2*exp(3*z/2)*cos(z*sqrt(3/4)))/3, z,n+2): seq(i!*coeff(%,z,i),i=0..n) end: A057681_list(38); # _Peter Luschny_, Jul 10 2012
%t Join[{1},LinearRecurrence[{3,-3},{1,1},40]] (* _Harvey P. Dale_, Aug 19 2014 *)
%o (PARI) x='x+O('x^40); Vec((1-x)^2/((1-x)^3+x^3)) \\ _G. C. Greubel_, Oct 23 2018
%o (Magma) I:=[1,1]; [1] cat [n le 2 select I[n] else 3*Self(n-1) - 3*Self(n-2): n in [1..40]]; // _G. C. Greubel_, Oct 23 2018
%o (GAP) a:=[1,1];; for n in [3..40] do a[n]:=3*a[n-1]-3*a[n-2]; od; Concatenation([1],a); # _Muniru A Asiru_, Oct 24 2018
%Y Cf. A009116, A009545, A057682, A057083, A103312.
%K sign,easy
%O 0,5
%A _N. J. A. Sloane_, Oct 20 2000