A123109 a(0) = 1, a(1) = 3, a(n) = 3*a(n-1) + 3 for n > 1.
1, 3, 12, 39, 120, 363, 1092, 3279, 9840, 29523, 88572, 265719, 797160, 2391483, 7174452, 21523359, 64570080, 193710243, 581130732, 1743392199, 5230176600, 15690529803, 47071589412, 141214768239, 423644304720, 1270932914163
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Madeleine Goertz and Aaron Williams, The Quaternary Gray Code and How It Can Be Used to Solve Ziggurat and Other Ziggu Puzzles, arXiv:2411.19291 [math.CO], 2024. See p. 17.
- Index entries for linear recurrences with constant coefficients, signature (4,-3).
Programs
-
GAP
a:=[1,3,12];; for n in [4..30] do a[n]:=4*a[n-1]-3*a[n-2]; od; a; # G. C. Greubel, May 24 2019
-
Magma
I:=[1, 3, 12]; [n le 3 select I[n] else 4*Self(n-1)-3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 27 2012
-
Mathematica
LinearRecurrence[{4,-3}, {1,3,12}, 30] (* Georg Fischer, May 24 2019 *) Join[{1},NestList[3#+3&,3,30]] (* Harvey P. Dale, Aug 16 2020 *)
-
PARI
my(x='x+O('x^30)); Vec((1-x+3*x^2)/(1-4*x+3*x^2)) \\ G. C. Greubel, May 24 2019
-
Sage
((1-x+3*x^2)/(1-4*x+3*x^2)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, May 24 2019
Formula
a(0) = 1 and a(n) = 3*A003462(n) for n > 0.
G.f.: (1-x+3*x^2)/(1-4*x+3*x^2). [Corrected by Georg Fischer, May 24 2019]
a(n) = Sum_{k=0..n} 3^k*A123110(n,k). - Philippe Deléham, Feb 09 2007
a(n) = A029858(n+1), n > 0. - R. J. Mathar, Jun 18 2008
a(n+1) - a(n) = 3^n, n >= 2. - R. J. Mathar, Aug 18 2011
E.g.f.: 1 + 3*(exp(3*x) - exp(x))/2. - G. C. Greubel, May 24 2019
Comments