A375966 Powers of 3 alternating with powers of 4.
1, 1, 3, 4, 9, 16, 27, 64, 81, 256, 243, 1024, 729, 4096, 2187, 16384, 6561, 65536, 19683, 262144, 59049, 1048576, 177147, 4194304, 531441, 16777216, 1594323, 67108864, 4782969, 268435456, 14348907, 1073741824, 43046721, 4294967296, 129140163, 17179869184
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,7,0,-12).
Programs
-
Mathematica
seq[len_] := Module[{m = Ceiling[len/2] - 1}, Riffle @@ Map[#^Range[0, m] &, {3, 4}]]; seq[36] (* Amiram Eldar, Sep 05 2024 *)
-
Python
def A375966(n): return 1<<(n^1) if n&1 else 3**(n>>1) # Chai Wah Wu, Sep 24 2024
Formula
a(n) = 7*a(n-2) - 12*a(n-4) for n >= 4.
From Stefano Spezia, Sep 06 2024: (Start)
G.f.: (1 + x - 4*x^2 - 3*x^3)/((1 - 2*x)*(1 + 2*x)*(1 - 3*x^2)).
a(n) = (4*3^(n/2)*A059841(n) - (-2)^n + 2^n)/4.
E.g.f.: cosh(sqrt(3)*x) + cosh(x)*sinh(x). (End)