A125145 a(n) = 3a(n-1) + 3a(n-2). a(0) = 1, a(1) = 4.
1, 4, 15, 57, 216, 819, 3105, 11772, 44631, 169209, 641520, 2432187, 9221121, 34959924, 132543135, 502509177, 1905156936, 7222998339, 27384465825, 103822392492, 393620574951, 1492328902329, 5657848431840, 21450532002507
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
- Jean-Paul Allouche, Jeffrey Shallit, and Manon Stipulanti, Combinatorics on words and generating Dirichlet series of automatic sequences, arXiv:2401.13524 [math.CO], 2025. See p. 14.
- Joerg Arndt, Matters Computational (The Fxtbook)
- D. Birmajer, J. B. Gil, and M. D. Weiner, On the Enumeration of Restricted Words over a Finite Alphabet, J. Int. Seq. 19 (2016) # 16.1.3, Example 7.
- Martin Burtscher, Igor Szczyrba, and Rafał Szczyrba, Analytic Representations of the n-anacci Constants and Generalizations Thereof, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.5.
- Brian Hopkins and Stéphane Ouvry, Combinatorics of Multicompositions, arXiv:2008.04937 [math.CO], 2020.
- Milan Janjic, On Linear Recurrence Equations Arising from Compositions of Positive Integers, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.7.
- Tanya Khovanova, Recursive Sequences
- Index entries for linear recurrences with constant coefficients, signature (3,3).
Crossrefs
Programs
-
Haskell
a125145 n = a125145_list !! n a125145_list = 1 : 4 : map (* 3) (zipWith (+) a125145_list (tail a125145_list)) -- Reinhard Zumkeller, Oct 15 2011
-
Magma
I:=[1,4]; [n le 2 select I[n] else 3*Self(n-1)+3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Nov 10 2014
-
Maple
a[0]:=1: a[1]:=4: for n from 2 to 27 do a[n]:=3*a[n-1]+3*a[n-2] od: seq(a[n],n=0..27); # Emeric Deutsch, Feb 27 2007 A125145 := proc(n) option remember; if n <= 1 then op(n+1,[1,4]) ; else 3*(procname(n-1)+procname(n-2)) ; end if; end proc: # R. J. Mathar, Feb 13 2022
-
Mathematica
nn=23;CoefficientList[Series[(1+x)/(1-3x-3x^2),{x,0,nn}],x] (* Geoffrey Critzer, Feb 09 2014 *) LinearRecurrence[{3,3},{1,4},30] (* Harvey P. Dale, May 01 2022 *)
Formula
G.f.: (1+z)/(1-3z-3z^2). - Emeric Deutsch, Feb 27 2007
a(n) = (5*sqrt(21)/42 + 1/2)*(3/2 + sqrt(21)/2)^n + (-5*sqrt(21)/42 + 1/2)*(3/2 - sqrt(21)/2)^n. - Antonio Alberto Olivares, Mar 20 2008
E.g.f.: exp(3*x/2)*(21*cosh(sqrt(21)*x/2) + 5*sqrt(21)*sinh(sqrt(21)*x/2))/21. - Stefano Spezia, Aug 04 2022
a(n) = (((3 + sqrt(21)) / 2)^(n+2) - ((3 - sqrt(21)) / 2)^(n+2)) / (3 * sqrt(21)). - Werner Schulte, Dec 17 2024
Comments