%I #133 Jan 03 2024 11:20:47
%S 1,1,-1,-5,-7,1,23,43,17,-95,-241,-197,329,1249,1511,-725,-5983,-9791,
%T -1633,26107,57113,35905,-99529,-306773,-314959,290401,1525679,
%U 2180155,-216727,-6973919,-13297657,-5673557,28545857,74112385,62587199,-97162757,-382087111,-472685951
%N Expansion of (1 - x)/(1 - 2*x + 3*x^2) in powers of x.
%C Type 2 generalized Gaussian Fibonacci integers.
%C Binomial transform of A077966. - _Philippe Deléham_, Dec 02 2008
%C The real component of Q^n, where Q is the quaternion 1 + 0*i + 1*j + 1*k. - _Stanislav Sykora_, Jun 11 2012
%C If entries are multiplied by 2*(-1)^n, which gives 2, -2, -2, 10, -14, -2, 46, -86, 34, 190, -482, 394, ..., we obtain the Lucas V(-2,3) sequence. - _R. J. Mathar_, Jan 08 2013
%C The real component of (1 + sqrt(-2))^n. - _Giovanni Resta_, Apr 01 2014
%C It is an open question whether or not this sequence satisfies Benford's law [Berger-Hill, 2017; Arno Berger, email, Jan 06 2017]. - _N. J. A. Sloane_, Feb 08 2017
%C Given an alternated cubic honeycomb with a planar dissection along a plane from edge to opposite edge of the containing cube. The sequence (1 + sqrt(-2))^n contains a real component representing distance along the edge of the tetrahedron/octahedron and an imaginary component representing the orthogonal distance along the sqrt(2) axis in a tetrahedron/octahedron, this generates a unique cevian (line from the apical vertex to a vertex on the triangular tiling composing the opposite face) in this plane with length (sqrt(3))^n. - _Jason Pruski_, Sep 04 2017, Jan 08 2018
%C From _Peter Bala_, Apr 01 2018: (Start)
%C This sequence is the Lucas sequence V(n,2,3). The companion Lucas sequence U(n,2,3) is A088137.
%C Define a binary operation o on rational numbers by x o y = (x + y)/(1 - 2*x*y). This is a commutative and associative operation with identity 0. Then 1 o 1 o ... o 1 (n terms) = A088137(n)/a(n). Cf. A025172 and A127357. (End)
%D Arno Berger and Theodore P. Hill. An Introduction to Benford's Law. Princeton University Press, 2015.
%D S. Severini, A note on two integer sequences arising from the 3-dimensional hypercube, Technical Report, Department of Computer Science, University of Bristol, Bristol, UK (October 2003).
%H Robert Israel, <a href="/A087455/b087455.txt">Table of n, a(n) for n = 0..3500</a>
%H Beata Bajorska-Harapińska, Barbara Smoleń, and Roman Wituła, <a href="https://doi.org/10.1007/s00006-019-0969-9">On Quaternion Equivalents for Quasi-Fibonacci Numbers, Shortly Quaternaccis</a>, Advances in Applied Clifford Algebras (2019) Vol. 29, 54.
%H A. Berger and T. P. Hill, <a href="http://www.ams.org/publications/journals/notices/201702/rnoti-p132.pdf">What is Benford's Law?</a>, Notices, Amer. Math. Soc., 64:2 (2017), 132-134.
%H F. Beukers, <a href="http://www.numdam.org/item?id=CM_1980__40_2_251_0">The multiplicity of binary recurrences</a>, Compositio Mathematica, Tome 40 (1980) no. 2 , p. 251-267. See Theorem 2 p. 259.
%H M. Mignotte, <a href="http://pmb.univ-fcomte.fr/1989/Mignotte.pdf">Propriétés arithmétiques des suites récurrentes</a>, Besançon, 1988-1989, see p. 14. In French.
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Lucas_sequence#Specific_names">Lucas sequence</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-3).
%H <a href="/index/Be#Benford">Index entries for sequences related to Benford's law</a>
%F a(n) = (3^(n/2))*cos(n*arctan(sqrt(2))). - _Paul Barry_, Oct 23 2003
%F From _Paul Barry_, Sep 03 2004: (Start)
%F a(n) = 2*a(n-1) - 3*a(n-2).
%F a(n) = (-1)^n*Sum_{m=0..n} binomial(n, m)*Sum_{k=0..n} binomial(m, 2k)2^(m-k).
%F Binomial transform of 1/(1 + 2*x^2), or (1, 0, -2, 0, 4, 0, -8, 0, 16, ...). (End)
%F a(n+1) = a(n+2) - 2*A088137(n+1), a(n+1) = A088137(n+2) - A088137(n+1). - _Creighton Dement_, Oct 28 2004
%F a(n) = upper left and lower right terms of [1,-2, 1,1]^n. - _Gary W. Adamson_, Mar 28 2008
%F a(n) = Sum_{k=0..n} A098158(n,k)*(-2)^(n-k). - _Philippe Deléham_, Nov 14 2008
%F a(n) = Sum_{k=0..n} A124182(n,k)*(-3)^(n-k). - _Philippe Deléham_, Nov 15 2008
%F G.f.: G(0)/2, where G(k) = 1 + 1/(1 - x*(2*k+1)/(x*(2*k+3) + 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, May 25 2013
%F a(n) = a(-n) * 3^n for all n in Z. - _Michael Somos_, Aug 25 2014
%F E.g.f.: (1/2)*(exp((1 - i*sqrt(2))*x) + exp((1 + i*sqrt(2))*x)), where i is the imaginary unit. - _Stefano Spezia_, Jul 17 2019
%e G.f. = 1 + x - x^2 - 5*x^3 - 7*x^4 + x^5 + 23*x6 + 43*x^7 + 17*x^8 - 95*x^9 + ...
%p Digits:=100; a:=n->round(abs(evalf((3^(n/2))*cos(n*arctan(sqrt(2))))));
%p # alternative:
%p a:= gfun:-rectoproc({a(n) = 2*a(n-1) - 3*a(n-2),a(0)=1,a(1)=1},a(n),remember):
%p map(a, [$0..100]); # _Robert Israel_, Jun 23 2015
%t CoefficientList[Series[(1-x)/(1-2*x+3*x^2), {x, 0, 40}], x] (* _Vaclav Kotesovec_, Apr 01 2014 *)
%t a[ n_] := ChebyshevT[ n, 1/Sqrt[3]] Sqrt[3]^n // Simplify; (* _Michael Somos_, May 15 2015 *)
%t LinearRecurrence[{2,-3},{1,1},50] (* _Harvey P. Dale_, Jul 30 2019 *)
%o (PARI) {a(n) = real( (1 + quadgen(-8))^n )}; /* _Michael Somos_, Jul 26 2006 */
%o (PARI) {a(n) = real( subst( poltchebi(n), 'x, quadgen(12) / 3) * quadgen(12)^n)}; /* _Michael Somos_, Jul 26 2006 */
%o (PARI) a(n)=simplify(polchebyshev(n,,quadgen(12)/3)*quadgen(12)^n) \\ _Charles R Greathouse IV_, Jun 26 2013
%o (Magma) [n le 2 select 1 else 2*Self(n-1) -3*Self(n-2): n in [1..41]]; // _G. C. Greubel_, Jan 03 2024
%o (SageMath) [sqrt(3)^n*chebyshev_T(n, 1/sqrt(3)) for n in range(41)] # _G. C. Greubel_, Jan 03 2024
%Y Cf. A025172, A048473, A077966, A084102, A088137, A088138, A098158, A124182, A127357.
%K easy,sign
%O 0,4
%A _Simone Severini_, Oct 23 2003
%E The explicit formula was given by _Paul Barry_.
%E Corrected and extended by _N. J. A. Sloane_, Aug 01 2004
%E More terms from _Creighton Dement_, Jul 31 2004