login
a(n) = Sum_{j=0..floor(n/3)} (-1)^j*binomial(n,3*j+1).
17

%I #79 Jul 14 2023 17:49:33

%S 0,1,2,3,3,0,-9,-27,-54,-81,-81,0,243,729,1458,2187,2187,0,-6561,

%T -19683,-39366,-59049,-59049,0,177147,531441,1062882,1594323,1594323,

%U 0,-4782969,-14348907,-28697814,-43046721,-43046721,0,129140163,387420489,774840978

%N a(n) = Sum_{j=0..floor(n/3)} (-1)^j*binomial(n,3*j+1).

%C Let M be any endomorphism on any vector space, such that M^3 = 1 (identity). Then (1-M)^n = A057681(n)-a(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 From _Tom Copeland_, Nov 09 2014: (Start)

%C This array belongs to an interpolated family of arrays associated to the Catalan A000108 (t=1), and Riordan, or Motzkin sums A005043 (t=0), with the interp. (here t=-2) o.g.f. G(x,t) = x(1-x)/[1+(t-1)x(1-x)] and inverse o.g.f. Ginv(x,t) = [1-sqrt(1-4x/(1+(1-t)x))]/2 (Cf. A005773 and A091867 and A030528 for more info on this family). (End)

%C {A057681, A057682, A*}, where A* is A057083 prefixed by two 0's, is the difference analog of the trigonometric functions {k_1(x), k_2(x), k_3(x)} of order 3. For the definitions of {k_i(x)} and the difference analog {K_i (n)} see [Erdelyi] and the Shevelev link respectively. - _Vladimir Shevelev_, Jul 31 2017

%D A. Erdelyi, Higher Transcendental Functions, McGraw-Hill, 1955, Vol. 3, Chapter XVIII.

%H G. C. Greubel, <a href="/A057682/b057682.txt">Table of n, a(n) for n = 0..1000</a>

%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 preprint arXiv:1506.09160 [math.CA], 2015.

%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 G.f.: (x - x^2) / (1 - 3*x + 3*x^2).

%F a(n) = 3*a(n-1) - 3*a(n-2), if n>1.

%F Starting at 1, the binomial transform of A000484. - _Paul Barry_, Jul 21 2003

%F It appears that abs(a(n)) = floor(abs(A000748(n))/3). - _John W. Layman_, Sep 05 2003

%F a(n) = ((3+i*sqrt(3))/2)^(n-2) + ((3-i*sqrt(3))/2)^(n-2). - _Benoit Cloitre_, Oct 27 2003

%F a(n) = n*3F2(1/3-n/3,2/3-n/3,1-n/3 ; 2/3,4/3 ; 1) for n>=1. - _John M. Campbell_, Jun 01 2011

%F Let A(n) be the n X n matrix with -1's along the main diagonal, 1's everywhere above the main diagonal, and 1's along the subdiagonal. Then a(n) equals (-1)^(n-1) times the sum of the coefficients of the characteristic polynomial of A(n-1), for all n>1 (see Mathematica code below). - _John M. Campbell_, Mar 16 2012

%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) = -y(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 a(n) = A057083(n-1) - A057083(n-2). - _R. J. Mathar_, Oct 25 2012

%F G.f.: 3*x - 1/3 + 3*x/(G(0) - 1) where G(k)= 1 + 3*(2*k+3)*x/(2*k+1 - 3*x*(k+2)*(2*k+1)/(3*x*(k+2) + (k+1)/G(k+1)));(continued fraction, 3rd kind, 3-step). - _Sergei N. Gladkovskii_, Nov 23 2012

%F G.f.: Q(0,u) -1, where u=x/(1-x), Q(k,u) = 1 - u^2 + (k+2)*u - u*(k+1 - u)/Q(k+1); (continued fraction). - _Sergei N. Gladkovskii_, Oct 07 2013

%F From _Vladimir Shevelev_, Jul 31 2017: (Start)

%F For n>=1, a(n) = 2*3^((n-2)/2)*cos(Pi*(n-2)/6);

%F For n>=2, a(n) = K_1(n) + K_3(n-2);

%F For m,n>=2, a(n+m) = a(n)*K_1(m) + K_1(n)*a(m) - K_3(n-2)*K_3(m-2), where

%F K_1 = A057681, K_3 = A057083. (End)

%e G.f. = x + 2*x^2 + 3*x^3 + 3*x^4 - 9*x^6 - 27*x^7 - 54*x^8 - 81*x^9 + ...

%e If M^3=1 then (1-M)^6 = A057681(6) - a(6)*M + A057083(4)*M^2 = -18 + 9*M + 9*M^2. - _Stanislav Sykora_, Jun 10 2012

%p A057682:=n->add((-1)^j*binomial(n,3*j+1), j=0..floor(n/3)):

%p seq(A057682(n), n=0..50); # _Wesley Ivan Hurt_, Nov 11 2014

%t A[n_] := Array[KroneckerDelta[#1, #2 + 1] - KroneckerDelta[#1, #2] + Sum[KroneckerDelta[#1, #2 -q], {q, n}] &, {n, n}];

%t Join[{0,1}, Table[(-1)^(n-1)*Total[CoefficientList[ CharacteristicPolynomial[A[(n-1)], x], x]], {n,2,30}]] (* _John M. Campbell_, Mar 16 2012 *)

%t Join[{0}, LinearRecurrence[{3,-3}, {1,2}, 40]] (* _Jean-François Alcover_, Jan 08 2019 *)

%o (PARI) {a(n) = sum( j=0, n\3, (-1)^j * binomial(n, 3*j + 1))} /* _Michael Somos_, May 26 2004 */

%o (PARI) {a(n) = if( n<2, n>0, n-=2; polsym(x^2 - 3*x + 3, n)[n + 1])} /* _Michael Somos_, May 26 2004 */

%o (Magma) I:=[0,1,2]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2): n in [1..45]]; // _Vincenzo Librandi_, Nov 10 2014

%o (SageMath)

%o b=BinaryRecurrenceSequence(3,-3,1,2)

%o def A057682(n): return 0 if n==0 else b(n-1)

%o [A057682(n) for n in range(41)] # _G. C. Greubel_, Jul 14 2023

%Y Alternating row sums of triangle A030523.

%Y Cf. A000108, A000484, A000748, A005043, A005773, A057083, A057681, A091867.

%K sign,easy

%O 0,3

%A _N. J. A. Sloane_, Oct 20 2000