login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = 2^n + 2*(-1)^n - 1.
1

%I #14 Sep 08 2022 08:46:15

%S 2,-1,5,5,17,29,65,125,257,509,1025,2045,4097,8189,16385,32765,65537,

%T 131069,262145,524285,1048577,2097149,4194305,8388605,16777217,

%U 33554429,67108865,134217725,268435457,536870909,1073741825,2147483645,4294967297,8589934589

%N a(n) = 2^n + 2*(-1)^n - 1.

%C Fermat numbers > 3 from A000215 are terms.

%C Prime terms are in A269018.

%C Union of A052539 and A267921.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-2).

%F G.f.: (2-5*x+5*x^2)/((1-2*x)*(1-x^2)). - _Vincenzo Librandi_, Feb 18 2016

%e For n = 6; a(n) = 2^n + 2*(-1)^n - 1 = 2^6 + 2*(-1)^6 - 1 = 65.

%t Table [2^n + 2 (-1)^n - 1, {n, 0, 80}] (* or *) CoefficientList[Series[(2 - 5 x + 5 x^2) / ((1 - 2 x) (1 - x^2)), {x, 0, 33}], x] (* _Vincenzo Librandi_, Feb 18 2016 *)

%t LinearRecurrence[{2,1,-2},{2,-1,5},40] (* _Harvey P. Dale_, Feb 25 2022 *)

%o (Magma) [2^n + 2*(-1)^n - 1: n in [0..300]]

%Y Cf. A019434, A052539, A092506, A176680, A267921, A269018.

%K sign

%O 0,1

%A _Jaroslav Krizek_, Feb 17 2016