%I M2520 N0995 #89 Aug 05 2024 04:15:37
%S 1,-3,6,-9,9,0,-27,81,-162,243,-243,0,729,-2187,4374,-6561,6561,0,
%T -19683,59049,-118098,177147,-177147,0,531441,-1594323,3188646,
%U -4782969,4782969,0,-14348907,43046721,-86093442,129140163,-129140163,0,387420489,-1162261467
%N Expansion of bracket function.
%C It appears that the sequence coincides with its third-order absolute difference. - _John W. Layman_, Sep 05 2003
%C It appears that, for n > 0, the (unsigned) a(n) = 3*|A057682(n)| = 3*|Sum_{j=0..floor(n/3)} (-1)^j*binomial(n,3*j+1)|. - _John W. Layman_, Sep 05 2003
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Alois P. Heinz, <a href="/A000748/b000748.txt">Table of n, a(n) for n = 0..1000</a>
%H H. W. Gould, <a href="http://www.fq.math.ca/Scanned/2-4/gould.pdf">Binomial coefficients, the bracket function and compositions with relatively prime summands</a>, Fib. Quart. 2(4) (1964), 241-260.
%H Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
%H Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-3,-3).
%F G.f.: 1/((1+x)^3-x^3).
%F a(n) = A007653(3^n).
%F a(n) = -3*a(n-1) - 3*a(n-2). - _Paul Curtz_, May 12 2008
%F a(n) = Sum_{k=1..n} binomial(k,n-k)*(-3)^(k) for n > 0; a(0)=1. - _Vladimir Kruchinin_, Feb 07 2011
%F G.f.: 1/(1 + 3*x /(1 - x /(1+x))). - _Michael Somos_, May 12 2012
%F G.f.: G(0)/2, where G(k) = 1 + 1/( 1 - 3*x*(2*k+1 + x)/(3*x*(2*k+2 + x) - 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Feb 09 2014
%F a(n) = 2*3^(n/2)*sin((1-5*n)*Pi/6). - _Jean-François Alcover_, Mar 12 2014
%F a(n) = (-1)^n * Sum_{k=0..floor(n/3)} (-1)^k * binomial(n+2,3*k+2). - _Seiichi Manyama_, Aug 05 2024
%e G.f. = 1 - 3*x + 6*x^2 - 9*x^3 + 9*x^4 - 27*x^6 + 81*x^7 - 162*x^8 + ...
%p A000748:=(-1-2*z-3*z**2-3*z**3+18*z**5)/(-1+z+9*z**5); # conjectured by _Simon Plouffe_ in his 1992 dissertation; gives sequence apart from signs
%p a:= n-> (Matrix([[ -3,1], [ -3,0]])^n)[1,1]: seq(a(n), n=0..40); # _Alois P. Heinz_, Sep 06 2008
%t a[n_] := 2*3^(n/2)*Sin[(1-5*n)*Pi/6]; Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Mar 12 2014 *)
%t LinearRecurrence[{-3, -3}, {1, -3}, 40] (* _Jean-François Alcover_, Feb 11 2016 *)
%o (PARI) {a(n) = if( n<0, 0, polcoeff(1 / (1 + 3*x + 3*x^2) + x * O(x^n), n))}; /* _Michael Somos_, Jun 07 2005 */
%o (PARI) {a(n) = if( n<0, 0, 3^((n+1)\2) * (-1)^(n\6) * ((-1)^n + (n%3==2)))}; /* _Michael Somos_, Sep 29 2007 */
%o (Magma) I:=[1,-3]; [n le 2 select I[n] else -3*Self(n-1)-3*Self(n-2): n in [1..40]]; // _Vincenzo Librandi_, Feb 11 2016
%Y Column 3 of A307047.
%Y Cf. A000749, A000750, A001659.
%Y Cf. A057682.
%K sign,easy,eigen
%O 0,2
%A _N. J. A. Sloane_