A042950 Row sums of the Lucas triangle A029635.
2, 3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304, 196608, 393216, 786432, 1572864, 3145728, 6291456, 12582912, 25165824, 50331648, 100663296, 201326592, 402653184, 805306368, 1610612736, 3221225472, 6442450944
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- S. Kitaev and T. Mansour, Counting the occurrences of generalized patterns in words generated by a morphism, arXiv:math/0210170 [math.CO], 2002.
- Index entries for linear recurrences with constant coefficients, signature (2).
Programs
-
Magma
[2] cat [2^(n+1) - 2^(n-1): n in [1..40]]; // Vincenzo Librandi, Aug 08 2015
-
Mathematica
Table[ Ceiling[3*2^(n - 1)], {n, 0, 32}] (* Robert G. Wilson v, Jul 08 2006 *) a[0] = 2; a[1] = 3; a[n_] := 2a[n - 1]; Table[a[n], {n, 0, 32}] (* Robert G. Wilson v, Jul 08 2006 *) f[s_] := Append[s, 1 + Plus @@ s]; Nest[f, {2}, 32] (* Robert G. Wilson v, Jul 08 2006 *) CoefficientList[Series[(2 - x)/(1 - 2x), {x, 0, 32}], x] (* Robert G. Wilson v, Jul 08 2006 *)
-
PARI
a(n)=ceil(3*2^(n-1))
-
Python
def A042950(n): return (3*2**n + int(n==0))//2 # G. C. Greubel, Jun 06 2025
Formula
G.f.: (2-x)/(1-2*x).
a(n) = 2*a(n-1), n > 1; a(0)=2, a(1)=3.
a(n) = A003945(n), for n > 0.
From Paul Barry, Dec 06 2004: (Start)
Binomial transform of 2, 1, 2, 1, 2, 1, ... = (3+(-1)^n)/2.
a(n) = (3*2^n + 0^n)/2. (End)
a(0) = 2, a(n) = 3*2^(n-1) = 2^n + 2^(n-1) for n >= 1. - Jaroslav Krizek, Aug 17 2009
a(n) = 2^(n+1) - 2^(n-1), for n > 0. - Ilya Gutkovskiy, Aug 08 2015
E.g.f.: (3*exp(2*x) + 1)/2. - G. C. Greubel, Jun 06 2025
Comments