%I M0933 #67 Dec 27 2023 11:52:48
%S 0,2,4,-2,-24,-38,44,278,336,-718,-3116,-2642,10296,33802,16124,
%T -136762,-354144,-24478,1721764,3565918,-1476984,-20783558,-34182196,
%U 35553398,242017776,306268562,-597551756,-2726446322,-2465133864,8701963882,29729597084,15949374758
%N Imaginary part of (1+2i)^n.
%C The absolute values of these numbers are the even numbers x such that x^2 + y^2 = 5^n with x and y coprime. See A098122. - _T. D. Noe_, Apr 14 2011
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Vincenzo Librandi, <a href="/A006496/b006496.txt">Table of n, a(n) for n = 0..200</a>
%H George Berzsenyi, <a href="http://www.fq.math.ca/Scanned/15-3/berzsenyi.pdf">Gaussian Fibonacci numbers</a>, Fib. Quart., Vol. 15, No. 3 (1977), pp. 233-236.
%H <a href="/index/Ga#gaussians">Index entries for Gaussian integers and primes</a>.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-5).
%F a(n) = 2*a(n-1) - 5*a(n-2); a(0)=0, a(1)=2. - _T. D. Noe_, Nov 09 2006
%F a(n) = - [M^n]_1,2, where M = [1, -2; 2, 1]. - _Simone Severini_, Apr 25 2007
%F A000351(n) = A006495(n)^2 + a(n)^2. - _Fabrice Baubet_, May 28 2007
%F From _R. J. Mathar_, Apr 06 2008: (Start)
%F O.g.f.: 2*x/(1 - 2*x + 5*x^2).
%F a(n) = 2*A045873(n). (End)
%F E.g.f.: exp(x)*sin(2*x). - _Sergei N. Gladkovskii_, Jul 22 2012
%F a(n)/A006495(n) = -tan(2*n*arctan(phi)), where phi is the golden ratio (A001622). - _Amiram Eldar_, Jan 13 2022
%t LinearRecurrence[{2,-5},{0,2},30] (* _Vincenzo Librandi_, Dec 21 2011 *)
%o (Magma) I:=[0,2]; [n le 2 select I[n] else 2*Self(n-1)-5*Self(n-2): n in [1..40]]; // _Vincenzo Librandi_, Dec 21 2011
%o (PARI) a(n)=([1, -2; 2, 1]^n)[1,2] \\ _Charles R Greathouse IV_, Dec 22 2011
%Y Cf. A000351, A001622, A006495, A098122, A045873.
%K sign,easy
%O 0,2
%A _N. J. A. Sloane_
%E Signs from _Christian G. Bower_, Nov 15 1998
%E Corrected by _T. D. Noe_, Nov 09 2006
%E More terms from _R. J. Mathar_, Apr 06 2008