A140590 Exchange successive pairs of terms of A000051.
3, 2, 9, 5, 33, 17, 129, 65, 513, 257, 2049, 1025, 8193, 4097, 32769, 16385, 131073, 65537, 524289, 262145, 2097153, 1048577, 8388609, 4194305, 33554433, 16777217, 134217729, 67108865, 536870913, 268435457, 2147483649, 1073741825, 8589934593, 4294967297, 34359738369
Offset: 0
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,4,-4).
Crossrefs
Cf. A000051.
Programs
-
Mathematica
LinearRecurrence[{1,4,-4},{3,2,9},35] (* or *) CoefficientList[Series[(3 - x - 5*x^2)/((1 - x)*(1 - 2*x)*(1 + 2*x)),{x,0,34}],x] (* or *) a[n_]:= 2^(n + (-1)^n) + 1;Array[a,35,0] (* James C. McMahon, Jul 12 2025 *)
-
PARI
a(n)={(1<
Andrew Howroyd, Jan 03 2020 -
PARI
Vec((3 - x - 5*x^2)/((1 - x)*(1 - 2*x)*(1 + 2*x)) + O(x^40)) \\ Andrew Howroyd, Jan 03 2020
Formula
From Andrew Howroyd, Jan 03 2020: (Start)
a(n) = 2^(n + (-1)^n) + 1.
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) for n >= 3.
G.f.: (3 - x - 5*x^2)/((1 - x)*(1 - 2*x)*(1 + 2*x)). (End)
Extensions
Terms a(16) and beyond from Andrew Howroyd, Jan 03 2020