Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Mar 17 2024 12:54:54
%S 4,1,-9,-2,31,1,-126,1,511,-2,-2049,1,8194,1,-32769,-2,131071,1,
%T -524286,1,2097151,-2,-8388609,1,33554434,1,-134217729,-2,536870911,1,
%U -2147483646,1,8589934591,-2,-34359738369,1
%N a(n) = (-2*I)^n + (2*I)^n + (1/2 + 1/2*I*sqrt(3))^n + (1/2 - 1/2*I*sqrt(3))^n.
%C For all n there is an m such that: ||a(n)| - 2^m| <= 2. In the Python program which will be provided, the sequence (a(n)) is given by 4tesseq(X) where X = 1.5'i + .25(ii + jj + kk + ee) is the generating floretion.
%H Vincenzo Librandi, <a href="/A153265/b153265.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,-5,4,-4).
%F a(n) = a(n-1) - 5a(n-2) + 4a(n-3) - 4a(n-4).
%F G.f.: 4 + x*(1-10*x+12*x^2-16*x^3)/((x^2-x+1)*(4*x^2+1)). - corrected by _Vaclav Kotesovec_, Jun 25 2014
%e a(4) = 32 + (1/2 + 1/2*I*sqrt(3))^4 + (1/2 - 1/2*I*sqrt(3))^4 = 31 -or- a(4) = a(n-1) - 5a(n-2) + 4a(n-3) - 4a(n-4) = -2 - 5*(-9) + 4*(1) - 4*4 = 31
%p a := n-> (2*I)^n+(-2*I)^n+(1/2+1/2*I*sqrt(3))^n+(1/2-1/2*I*sqrt(3))^n;
%t CoefficientList[Series[4 + x (1 - 10 x + 12 x^2 - 16 x^3)/((x^2 - x + 1) (4 x^2 + 1)), {x, 0, 100}], x] (* _Vincenzo Librandi_, Jun 26 2014 *)
%o (PARI) a(n)=2*(n%2<1)*(-4)^(n\2)+3*(n%3<1)*(-1)^(n\3)-(-1)^n \\ _Tani Akinari_, Jun 25 2014
%o (Magma) I:=[4,1,-9,-2]; [n le 4 select I[n] else Self(n-1)-5*Self(n-2)+4*Self(n-3) -4*Self(n-4): n in [1..50]]; // _Vincenzo Librandi_, Jun 26 2014
%Y Cf. A153266, A153267, A153268.
%K easy,sign
%O 0,1
%A _Creighton Dement_, Dec 22 2008, Dec 31 2008