cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A215502 a(n) = (1+sqrt(3))^n + (-2)^n + (1-sqrt(3))^n + 1.

This page as a plain text file.
%I A215502 #21 Sep 08 2022 08:46:03
%S A215502 4,1,13,13,73,121,481,1009,3361,7969,24193,61249,177025,464257,
%T A215502 1307137,3493633,9699841,26190337,72173569,195941377,537802753,
%U A215502 1464342529,4010582017,10937266177,29920862209,81665925121,223274237953,609678999553,1666309128193
%N A215502 a(n) = (1+sqrt(3))^n + (-2)^n + (1-sqrt(3))^n + 1.
%H A215502 G. C. Greubel, <a href="/A215502/b215502.txt">Table of n, a(n) for n = 0..1000</a>
%H A215502 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,6,-2,-4).
%F A215502 From _Colin Barker_, Aug 20 2012: (Start)
%F A215502 a(n) = a(n-1) +6*a(n-2) -2*a(n-3) -4*a(n-4).
%F A215502 G.f.: (4-3*x-12*x^2+2*x^3)/((1-x)*(1+2*x)*(1-2*x-2*x^2)). (End)
%p A215502 A215502 := n -> 1+(1+sqrt(3))^n+(-2)^n+(1-sqrt(3))^n;
%p A215502 seq(simplify(A215502(i)),i=0..28);
%t A215502 Simplify/@Table[(1+Sqrt[3])^n+(1-Sqrt[3])^n+1+(-2)^n,{n,0,30}] (* or *) LinearRecurrence[{1,6,-2,-4},{4,1,13,13},30] (* _Harvey P. Dale_, Mar 12 2013 *)
%o A215502 def A215502(n) : return 1+(1+sqrt(3))^n+(-2)^n+(1-sqrt(3))^n
%o A215502 [A215502(i).round() for i in (0..28)]
%o A215502 (PARI) x='x+O('x^30); Vec((4-3*x-12*x^2+2*x^3)/((1-x)*(1+2*x)*(1-2*x-2*x^2))) \\ _G. C. Greubel_, Apr 23 2018
%o A215502 (Magma) [Round((1+Sqrt(3))^n + (-2)^n + (1-Sqrt(3))^n + 1): n in [0..30]]; // _G. C. Greubel_, Apr 23 2018
%Y A215502 Cf. A051927, A215500, A215503.
%K A215502 nonn,easy
%O A215502 0,1
%A A215502 _Peter Luschny_, Aug 13 2012