A006012 a(0) = 1, a(1) = 2, a(n) = 4*a(n-1) - 2*a(n-2), n >= 2.
1, 2, 6, 20, 68, 232, 792, 2704, 9232, 31520, 107616, 367424, 1254464, 4283008, 14623104, 49926400, 170459392, 581984768, 1987020288, 6784111616, 23162405888, 79081400320, 270000789504, 921840357376, 3147359850496
Offset: 0
References
- D. H. Greene and D. E. Knuth, Mathematics for the Analysis of Algorithms. Birkhäuser, Boston, 3rd edition, 1990, p. 86.
- D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 5.4.8 Answer to Exer. 8.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Andrei Asinowski and Cyril Banderier, From geometry to generating functions: rectangulations and permutations, arXiv:2401.05558 [cs.DM], 2024. See page 2.
- Andrei Asinowski and Toufik Mansour, Separable d-Permutations and Guillotine Partitions, arXiv 0803.3414 [math.CO], 2008. Annals of Combinatorics 14 (1) pp.17-43 Springer, 2010; Abstract
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 155
- George Balla, Ghislain Fourier, and Kunda Kambaso, PBW filtration and monomial bases for Demazure modules in types A and C, arXiv:2205.01747 [math.RT], 2022.
- M. Barnabei, F. Bonetti, and M. Silimbani, Two permutation classes related to the Bubble Sort operator, Electronic Journal of Combinatorics 19(3) (2012), #P25. - From _N. J. A. Sloane_, Dec 25 2012
- Yonah Biers-Ariel, A New Quantity Counted by OEIS Sequence A006012, arXiv:1706.07064 [math.CO], 2017.
- Yonah Biers-Ariel, The Number of Permutations Avoiding a Set of Generalized Permutation Patterns, Journal of Integer Sequences, Vol. 20 (2017), Article 17.8.3.
- Rocco Chirivì, Xin Fang, and Ghislain Fourier, Degenerate Schubert varieties in type A, Transformation Groups (2020).
- CombOS - Combinatorial Object Server, Generate pattern-avoiding permutations
- Sergi Elizalde, The X-class and almost-increasing permutations, arXiv:0710.5168 [math:CO], 2007. Ann. Comb. 15 (2011), 51-68.
- S. Felsner and D. Heldt, Lattice Path Enumeration and Toeplitz Matrices, J. Int. Seq. 18 (2015) # 15.1.3.
- Luca Ferrari, Enhancing the connections between patterns in permutations and forbidden configurations in restricted elections, arXiv:1906.10553 [math.CO], 2019.
- Elizabeth Hartung, Hung Phuc Hoang, Torsten Mütze, and Aaron Williams, Combinatorial generation via permutation languages. I. Fundamentals, arXiv:1906.06069 [cs.DM], 2019.
- Alice L. L. Gao and Sergey Kitaev, On partially ordered patterns of length 4 and 5 in permutations, arXiv:1903.08946 [math.CO], 2019.
- Alice L. L. Gao and Sergey Kitaev, On partially ordered patterns of length 4 and 5 in permutations, The Electronic Journal of Combinatorics 26(3) (2019), P3.26.
- L. E. Jeffery, Unit-primitive matrices
- Donghyun Kim and Lauren Williams, Schubert polynomials, the inhomogeneous TASEP, and evil-avoiding permutations, arXiv:2106.13378 [math.CO], 2021.
- Sergey Kitaev and Artem Pyatkin, On permutations avoiding partially ordered patterns defined by bipartite graphs, arXiv:2204.08936 [math.CO], 2022.
- Joshua Marsh and Nathan Williams, Nesting Nonpartitions, J. Int. Seq., Vol. 25 (2022), Article 22.8.8.
- Arturo Merino and Torsten Mütze, Combinatorial generation via permutation languages. III. Rectangulations, arXiv:2103.09333 [math.CO], 2021.
- Joris Nieuwveld, Fractions, Functions and Folding. A Novel Link between Continued Fractions, Mahler Functions and Paper Folding, Master's Thesis, arXiv:2108.11382 [math.NT], 2021.
- Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
- Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
- J. Riordan, The distribution of crossings of chords joining pairs of 2n points on a circle, Math. Comp., 29 (1975), 215-222.
- Markus Saers, Dekai Wu, and Chris Quirk, On the Expressivity of Linear Transductions.
- Yi-dong Sun and Cang-zhi Jia, Counting Dyck paths with strictly increasing peak sequences, J. Math. Res. Expos. 27 (2) (2007) 253, Theorem 3.11.
- Index entries for linear recurrences with constant coefficients, signature (4,-2).
Crossrefs
Programs
-
Haskell
a006012 n = a006012_list !! n a006012_list = 1 : 2 : zipWith (-) (tail $ map (* 4) a006012_list) (map (* 2) a006012_list) -- Reinhard Zumkeller, Oct 03 2011
-
Magma
[n le 2 select n else 4*Self(n-1)- 2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Apr 05 2011
-
Maple
A006012:=-(-1+2*z)/(1-4*z+2*z**2); # Simon Plouffe in his 1992 dissertation with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=24; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..7); od: seq(a(2*n),n=0..nmax); # Johannes W. Meijer, May 29 2010
-
Mathematica
LinearRecurrence[{4,-2},{1,2},50] (* or *) With[{c=Sqrt[2]}, Simplify[ Table[((2+c)^n+(3+2c)(2-c)^n)/(2(2+c)),{n,50}]]] (* Harvey P. Dale, Aug 29 2011 *)
-
PARI
{a(n) = real(((2 + quadgen(8))^n))}; /* Michael Somos, Feb 12 2004 */
-
PARI
{a(n) = if( n<0, 2^n, 1) * polsym(x^2 - 4*x + 2, abs(n))[abs(n)+1] / 2}; /* Michael Somos, Feb 12 2004 */
-
PARI
Vec((1-2*x)/(1-4*x+2*x^2) + O(x^100)) \\ Altug Alkan, Dec 05 2015
-
Python
l = [1, 2] for n in range(2, 101): l.append(4 * l[n - 1] - 2 * l[n - 2]) print(l) # Indranil Ghosh, Jul 02 2017
-
SageMath
A006012=BinaryRecurrenceSequence(4,-2,1,2) print([A006012(n) for n in range(41)]) # G. C. Greubel, Aug 27 2025
Formula
G.f.: (1-2*x)/(1 - 4*x + 2*x^2).
Limit_{n -> oo} a(n)/a(n-1) = 2 + sqrt(2). - Zak Seidov, Oct 12 2002
From Paul Barry, May 08 2003: (Start)
Binomial transform of A001333.
E.g.f.: exp(2*x)*cosh(sqrt(2)*x). (End)
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)*2^(n-k) = Sum_{k=0..n} binomial(n, k)*2^(n-k/2)(1+(-1)^k)/2. - Paul Barry, Nov 22 2003 (typo corrected by Manfred Scheucher, Jan 17 2023)
a(n) = ((2+sqrt(2))^n + (2-sqrt(2))^n)/2.
a(n) = [M^n]{2,2}, where M is the 3 X 3 matrix: M = [1,1,1;1,2,1;1,1,1]. - _Simone Severini, Jun 11 2006
a(n) = Sum_{k=0..n} 2^k*A098158(n,k). - Philippe Deléham, Dec 04 2006
a(n) = Sum_{k=0..n} A147703(n,k). - Philippe Deléham, Nov 29 2008
a(n) = Sum_{k=0..n} A201730(n,k). - Philippe Deléham, Dec 05 2011
G.f.: G(0) where G(k)= 1 + 2*x/((1-2*x) - 2*x*(1-2*x)/(2*x + (1-2*x)*2/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 10 2012
G.f.: G(0)*(1-2*x)/2, where G(k) = 1 + 1/(1 - 2*x*(4*k+2-x)/( 2*x*(4*k+4-x) + 1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 27 2014
a(-n) = a(n) / 2^n for all n in Z. - Michael Somos, Aug 24 2014
a(n) = A265185(n) / 4, connecting this sequence to the simple Lie algebra B_4. - Tom Copeland, Dec 04 2015
From G. C. Greubel, Aug 27 2025: (Start)
a(n) = 2^(n/2)*ChebyshevT(n, sqrt(2)). (End)
Comments