cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 21-30 of 4476 results. Next

A002896 Number of 2n-step polygons on cubic lattice.

Original entry on oeis.org

1, 6, 90, 1860, 44730, 1172556, 32496156, 936369720, 27770358330, 842090474940, 25989269017140, 813689707488840, 25780447171287900, 825043888527957000, 26630804377937061000, 865978374333905289360, 28342398385058078078010, 932905175625150142902300
Offset: 0

Views

Author

Keywords

Comments

Number of walks with 2n steps on the cubic lattice Z^3 beginning and ending at (0,0,0).
If A is a random matrix in USp(6) (6 X 6 complex matrices that are unitary and symplectic) then a(n) is the 2n-th moment of tr(A^k) for all k >= 7. - Andrew V. Sutherland, Mar 24 2008
Diagonal of the rational function R(x,y,z,w) = 1/(1 - (w*x*y + w*x*z + w*y + x*z + y + z)). - Gheorghe Coserea, Jul 14 2016
Constant term in the expansion of (x + 1/x + y + 1/y + z + 1/z)^(2n). - Harry Richman, Apr 29 2020

Examples

			1 + 6*x + 90*x^2 + 1860*x^3 + 44730*x^4 + 1172556*x^5 + 32496156*x^6 + ...
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

C(2n, n) times A002893.
Related to diagonal of rational functions: A268545-A268555.
Row k=3 of A287318.

Programs

  • Maple
    a := proc(n) local k; binomial(2*n,n)*add(binomial(n,k)^2 *binomial(2*k,k), k=0..n); end;
    # second Maple program
    a:= proc(n) option remember; `if`(n<2, 5*n+1,
          (2*(2*n-1)*(10*n^2-10*n+3) *a(n-1)
           -36*(n-1)*(2*n-1)*(2*n-3) *a(n-2)) /n^3)
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Nov 02 2012
    A002896 := n -> binomial(2*n,n)*hypergeom([1/2, -n, -n], [1, 1], 4):
    seq(simplify(A002896(n)), n=0..16); # Peter Luschny, May 23 2017
  • Mathematica
    Table[Binomial[2n,n] Sum[Binomial[n,k]^2 Binomial[2k,k],{k,0,n}],{n,0,20}] (* Harvey P. Dale, Jan 24 2012 *)
    a[ n_] := If[ n < 0, 0, HypergeometricPFQ[ {-n, -n, 1/2}, {1, 1}, 4] Binomial[ 2 n, n]] (* Michael Somos, May 21 2013 *)
  • PARI
    a(n)=binomial(2*n,n)*sum(k=0,n,binomial(n, k)^2*binomial(2*k, k)) \\ Charles R Greathouse IV, Oct 31 2011
    
  • Sage
    def A002896():
        x, y, n = 1, 6, 1
        while True:
            yield x
            n += 1
            x, y = y, ((4*n-2)*((10*(n-1)*n+3)*y-18*(n-1)*(2*n-3)*x))//n^3
    a = A002896()
    [next(a) for i in range(17)]  # Peter Luschny, Oct 09 2013

Formula

a(n) = C(2*n, n)*Sum_{k=0..n} C(n, k)^2*C(2*k, k).
a(n) = (4^n*p(1/2, n)/n!)*hypergeom([-n, -n, 1/2], [1, 1], 4), where p(a, k) = Product_{i=0..k-1} (a+i).
E.g.f.: Sum_{n>=0} a(n)*x^(2*n)/(2*n)! = BesselI(0, 2*x)^3. - Corrected by Christopher J. Smyth, Oct 29 2012
D-finite with recurrence: n^3*a(n) = 2*(2*n-1)*(10*n^2-10*n+3)*a(n-1) - 36*(n-1)*(2*n-1)*(2*n-3)*a(n-2). - Vladeta Jovovic, Jul 16 2004
An asymptotic formula follows immediately from an observation of Bruce Richmond and me in SIAM Review - 31 (1989, 122-125). We use Hayman's method to find the asymptotic behavior of the sum of squares of the multinomial coefficients multi(n, k_1, k_2, ..., k_m) with m fixed. From this one gets a_n ~ (3/4)*sqrt(3)*6^(2*n)/(Pi*n)^(3/2). - Cecil C Rousseau (ccrousse(AT)memphis.edu), Mar 14 2006
G.f.: (1/sqrt(1+12*z)) * hypergeom([1/8,3/8],[1],64/81*z*(1+sqrt(1-36*z))^2*(2+sqrt(1-36*z))^4/(1+12*z)^4) * hypergeom([1/8, 3/8],[1],64/81*z*(1-sqrt(1-36*z))^2*(2-sqrt(1-36*z))^4/(1+12*z)^4). - Sergey Perepechko, Jan 26 2011
a(n) = binomial(2*n,n)*A002893(n). - Mark van Hoeij, Oct 29 2011
G.f.: (1/2)*(10-72*x-6*(144*x^2-40*x+1)^(1/2))^(1/2)*hypergeom([1/6, 1/3],[1],54*x*(108*x^2-27*x+1+(9*x-1)*(144*x^2-40*x+1)^(1/2)))^2. - Mark van Hoeij, Nov 12 2011
PSUM transform is A174516. - Michael Somos, May 21 2013
0 = (-x^2+40*x^3-144*x^4)*y''' + (-3*x+180*x^2-864*x^3)*y'' + (-1+132*x-972*x^2)*y' + (6-108*x)*y, where y is the g.f. - Gheorghe Coserea, Jul 14 2016
a(n) = [(x y z)^0] (x + 1/x + y + 1/y + z + 1/z)^(2*n). - Christopher J. Smyth, Sep 25 2018
a(n) = (1/Pi)^3*Integral_{0 <= x, y, z <= Pi} (2*cos(x) + 2*cos(y) + 2*cos(z))^(2*n) dx dy dz. - Peter Bala, Feb 10 2022
a(n) = Sum_{i+j+k=n, 0<=i,j,k<=n} multinomial(2n [i,i,j,j,k,k]). - Shel Kaphan, Jan 16 2023
Sum_{k>=0} a(k)/36^k = A086231 = (sqrt(3)-1) * (Gamma(1/24) * Gamma(11/24))^2 / (32*Pi^3). - Vaclav Kotesovec, Apr 23 2023
G.f.: HeunG(1/9,1/12,1/4,3/4,1,1/2,4*x)^2 (see Hassani et al.). - Stefano Spezia, Feb 16 2025

A002931 Number of self-avoiding polygons of length 2n on square lattice (not allowing rotations).

Original entry on oeis.org

0, 1, 2, 7, 28, 124, 588, 2938, 15268, 81826, 449572, 2521270, 14385376, 83290424, 488384528, 2895432660, 17332874364, 104653427012, 636737003384, 3900770002646, 24045500114388, 149059814328236, 928782423033008, 5814401613289290, 36556766640745936
Offset: 1

Views

Author

Keywords

Comments

Translations are allowed, but not rotations or reflections.
a(n) is also the coefficient of n^2 in the sequence of quadratic polynomials giving the numbers of 2k-cycles in the n X n grid graph for n >= k-1 (see the example). - Eric W. Weisstein, Apr 05 2018

Examples

			At length 8 there are 7 polygons, consisting of the 2, 1, 4 resp. rotations of:
._. .___. .___.
| | | . | | ._|
| | |___| |_|
|_|
Let p(k,n) be the number of 2k-cycles in the n X n grid graph for n >= k-1.  p(k,n) are quadratic polynomials in n, with the first few given by:
p(1,n) = 0,
p(2,n) = 1 - 2*n + n^2,
p(3,n) = 4 - 6*n + 2*n^2,
p(4,n) = 26 - 28*n + 7*n^2,
p(5,n) = 164 - 140*n + 28*n^2,
p(6,n) = 1046 - 740*n + 124*n^2,
p(7,n) = 6672 - 4056*n + 588*n^2,
p(8,n) = 42790 - 22904*n + 2938*n^2,
p(9,n) = 275888 - 132344*n + 15268*n^2,
...
The quadratic coefficients give a(n), so the first few are 0, 1, 2, 7, 28, 124, .... - _Eric W. Weisstein_, Apr 05 2018
		

References

  • N. Clisby and I. Jensen: A new transfer-matrix algorithm for exact enumerations: self-avoiding polygons on the square lattice, J. Phys. A: Math. Theor. 45 (2012). Also arXiv:1111.5877, 2011. [Extends sequence to a(65)]
  • I. G. Enting: Generating functions for enumerating self-avoiding rings on the square lattice, J. Phys. A: Math. Gen. 13 (1980). pp. 3713-3722. See Table 2.
  • A. J. Guttmann, Asymptotic analysis of power-series expansions, pp. 1-234 of C. Domb and J. L. Lebowitz, editors, Phase Transitions and Critical Phenomena. Vol. 13, Academic Press, NY, 1989.
  • B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 461.
  • I. Jensen: A parallel algorithm for the enumeration of self-avoiding polygons on the square lattice, J. Phys. A: Math. Gen. 36 (2003). [Extends sequence to a(55)]
  • I. Jensen and A. J. Guttmann: Self-avoiding polygons on the square lattice, J. Phys. A: Math. Gen. 32 (1999). Also arXiv:cond-mat/9905291. [Extends sequence to a(45)]
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A056634, A036638, A036639. Equals A010566(n)/(4n).
Cf. A057730.
Cf. A302335 (constant coefficients in p(k,n)).
Cf. A302336 (linear coefficients in p(k,n)).

Extensions

Updated by N. J. A. Sloane, Mar 18 2021

A005789 3-dimensional Catalan numbers.

Original entry on oeis.org

1, 1, 5, 42, 462, 6006, 87516, 1385670, 23371634, 414315330, 7646001090, 145862174640, 2861142656400, 57468093927120, 1178095925505960, 24584089974896430, 521086299271824330, 11198784501894470250, 243661974372798631650, 5360563436201569896300
Offset: 0

Views

Author

Keywords

Comments

Number of standard tableaux of shape (n,n,n). - Emeric Deutsch, May 13 2004
Number of walks within N^2 (the first quadrant of Z^2) starting and ending at (0,0) and consisting of 3 n steps taken from {(-1, 0), (0, 1), (1, -1)}. - Manuel Kauers, Nov 18 2008
Number of up-down permutations of length 2n with no four-term increasing subsequence, or equivalently the number of down-up permutations of length 2n with no four-term decreasing subsequence. (An up-down permutation is one whose descent set is {2, 4, 6, ...}.) - Joel B. Lewis, Oct 04 2009
Equivalent to the number of standard tableaux: number of rectangular arrangements of [1..3n] into n increasing sequences of size 3 and 3 increasing sequences of size n. a(n) counts a subset of A025035(n). - Olivier Gérard, Feb 15 2011
Number of walks in 3-dimensions using steps (1,0,0), (0,1,0), and (0,0,1) from (0,0,0) to (n,n,n) such that after each step we have z>=y>=x. - Thotsaporn Thanatipanonda, Feb 21 2012
Number of words consisting of n 'x' letters, n 'y' letters and n 'z' letters such that the 'x' count is always greater than or equal to the 'y' count and the 'y' count is always greater than or equal to the 'z' count; e.g., for n=2 we have xxyyzz, xxyzyz, xyxyzz, xyxzyz and xyzxyz. - Jon Perry, Nov 16 2012 [here "count" is meant as "number of symbols in any prefix", Joerg Arndt, Jan 02 2024]

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Snover, Stephen L.; and Troyer, Stephanie F.; A four-dimensional Catalan formula. Proceedings of the Nineteenth Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, MB, 1989). Congr. Numer. 75 (1990), 123-126.

Crossrefs

A row of A060854.
A subset of A025035.
See A268538 for primitive terms.

Programs

  • Magma
    [2*Factorial(3*n)/(Factorial(n)*Factorial(n+1)*Factorial(n+2)): n in [0..20]]; // Vincenzo Librandi, Oct 14 2017
    
  • Maple
    a:= n-> (3*n)! *mul(i!/(n+i)!, i=0..2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Feb 23 2012
  • Mathematica
    Needs["Combinatorica`"]
    Table[ NumberOfTableaux@ {n, n, n}, {n, 0, 17}] (* Robert G. Wilson v, Nov 15 2006 *)
    Table[2*(3*n)!/(n!*(n+1)!*(n+2)!),{n,0,20}] (* Vaclav Kotesovec, Nov 13 2014 *)
    aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, 1 + j, -1 + n] + aux[i, -1 + j, -1 + n] + aux[1 + i, j, -1 + n]]; Table[aux[0, 0, 3 n], {n, 0, 25}] (* Manuel Kauers, Nov 18 2008 *)
  • PARI
    a(n) = 2*(3*n)!/(n!*(n+1)!*(n+2)!); \\ Altug Alkan, Mar 14 2018

Formula

a(n) = 2*(3*n)!/(n!*(n+1)!*(n+2)!).
a(n) = 0!*1!*..*(k-1)! *(k*n)! / ( n!*(n+1)!*..*(n+k-1)! ) for k=3.
G.f.: (1/30)*(1/x-27)*(9*hypergeom([1/3, 2/3],[1],27*x)+(216*x+1)* hypergeom([4/3, 5/3],[2],27*x))-1/(3*x). - Mark van Hoeij, Oct 14 2009
a(n) ~ 3^(3*n+1/2) / (Pi*n^4). - Vaclav Kotesovec, Nov 13 2014
a(n) = 2*A001700(n+1)*A001764(n+1)/(3*(3*n+1)*(3*n+2)). - R. J. Mathar, Aug 10 2015
D-finite with recurrence (n+2)*(n+1)*a(n) -3*(3*n-1)*(3*n-2)*a(n-1)=0. - R. J. Mathar, Aug 10 2015
G.f.: x*3F2(4/3,5/3,1;4,3;27x). - R. J. Mathar, Aug 10 2015
E.g.f.: 2F2(1/3,2/3; 2,3; 27*x). - Ilya Gutkovskiy, Oct 13 2017

Extensions

Added a(0), merged A151334 into this one. - N. J. A. Sloane, Feb 24 2016

A005572 Number of walks on cubic lattice starting and finishing on the xy plane and never going below it.

Original entry on oeis.org

1, 4, 17, 76, 354, 1704, 8421, 42508, 218318, 1137400, 5996938, 31940792, 171605956, 928931280, 5061593709, 27739833228, 152809506582, 845646470616, 4699126915422, 26209721959656, 146681521121244, 823429928805936
Offset: 0

Views

Author

Keywords

Comments

Also number of paths from (0,0) to (n,0) in an n X n grid using only Northeast, East and Southeast steps and the East steps come in four colors. - Emeric Deutsch, Nov 03 2002
Number of skew Dyck paths of semilength n+1 with the left steps coming in two colors. - David Scambler, Jun 21 2013
Number of 2-colored Schroeder paths from (0,0) to (2n+2,0) with no level steps H=(2,0) at an even level. There are two ways to color an H-step at an odd level. Example: a(1)=4 because we have UUDD, UHD (2 choices) and UDUD. - José Luis Ramírez Ramírez, Apr 27 2015

Examples

			a(3) = 76 = sum of top row terms of M^3; i.e., (37 + 29 + 9 + 1).
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Binomial transform of A002212. Sequence shifted right twice is A025228.

Programs

  • Maple
    a := n -> simplify(2^n*hypergeom([3/2, -n], [3], -2)):
    seq(a(n), n=0..21); # Peter Luschny, Feb 03 2015
    a := n -> simplify(GegenbauerC(n, -n-1, -2))/(n+1):
    seq(a(n), n=0..21); # Peter Luschny, May 09 2016
  • Mathematica
    RecurrenceTable[{a[0]==1,a[1]==4,a[n]==((2n+1)a[n-1]-3(n-1)a[n-2]) 4/(n+2)}, a[n],{n,30}] (* Harvey P. Dale, Oct 04 2011 *)
    a[n_]:=If[n==0,1,Coefficient[(1+4x+x^2)^(n+1),x^n]/(n+1)]
    Table[a[n],{n,0,40}] (* Emanuele Munarini, Apr 06 2012 *)
  • Maxima
    a(n):=coeff(expand((1+4*x+x^2)^(n+1)),x^n)/(n+1); makelist(a(n),n,0,12); /* Emanuele Munarini, Apr 06 2012 */
    
  • PARI
    a(n)=polcoeff((1-4*x-sqrt(1-8*x+12*x^2+x^3*O(x^n)))/2,n+2)
    
  • PARI
    { A005572(n) = sum(k=0,n\2, binomial(n,2*k) * binomial(2*k,k) * 4^(n-2*k) / (k+1) ) } /* Max Alekseyev, Feb 02 2015 */
    
  • PARI
    {a(n)=sum(k=0,n, binomial(n,k) * 2^(n-k) * binomial(2*k+2, k)/(k+1) )}
    for(n=0,30,print1(a(n),", ")) \\ Paul D. Hanna, Feb 02 2015
    
  • Sage
    def A005572(n):
        A108198 = lambda n,k: (-1)^k*catalan_number(k+1)*rising_factorial(-n,k)/factorial(k)
        return sum(A108198(n,k)*2^(n-k) for k in (0..n))
    [A005572(n) for n in range(22)] # Peter Luschny, Feb 05 2015

Formula

Generating function A(x) satisfies 1 + (xA)^2 = A - 4xA.
a(0) = 1 and, for n > 0, a(n) = 4a(n-1) + Sum_{i=1..n-1} a(i-1)*a(n-i-1). - John W. Layman, Jan 07 2000
G.f.: (1 - 4*x - sqrt(1 - 8*x + 12*x^2))/(2*x^2).
D-finite with recurrence: a(n) = ((2*n+1)*a(n-1) - 3*(n-1)*a(n-2))*4/(n+2), n > 0.
a(m+n) = Sum_{k>=0} A052179(m, k)*A052179(n, k) = A052179(m+n, 0). - Philippe Deléham, Sep 15 2005
a(n) = 4*a(n-1) + A052177(n-1) = A052179(n, 0) = 6*A005573(n)-A005573(n-1) = Sum_{j=0..floor(n/2)} 4^(n-2*j)*C(n, 2*j)*C(2*j, j)/(j+1). - Henry Bottomley, Aug 23 2001
a(n) = Sum_{k=0..n} A097610(n,k)*4^k. - Philippe Deléham, Dec 03 2009
Let A(x) be the g.f., then B(x) = 1 + x*A(x) = 1 + 1*x + 4*x^2 + 17*x^3 + ... = 1/(1-z/(1-z/(1-z/(...)))) where z=x/(1-2*x) (continued fraction); more generally B(x) = C(x/(1-2*x)) where C(x) is the g.f. for the Catalan numbers (A000108). - Joerg Arndt, Mar 18 2011
From Gary W. Adamson, Jul 21 2011: (Start)
a(n) = sum of top row terms of M^n, M = an infinite square production matrix as follows:
3, 1, 0, 0, ...
1, 3, 1, 0, ...
1, 1, 3, 1, ...
1, 1, 1, 3, ...
... (End)
a(n) ~ 3*6^(n+1/2)/(n^(3/2)*sqrt(Pi)). - Vaclav Kotesovec, Oct 05 2012
a(n) = Sum_{k=0..floor(n/2)} binomial(n,2*k) * binomial(2k,k) * 4^(n-2k) / (k+1). - Max Alekseyev, Feb 02 2015
From Paul D. Hanna, Feb 02 2015: (Start)
a(n) = Sum_{k=0..n} binomial(n,k) * 2^(n-k) * binomial(2*k+2, k)/(k+1).
a(n) = Sum_{k=0..n} binomial(n,k) * 2^(n-k) * A000108(k+1).
a(n) = [x^n] (1 + 4*x + x^2)^(n+1) / (n+1).
G.f.: (1/x) * Series_Reversion( x/(1 + 4*x + x^2) ). (End)
a(n) = 2^n*hypergeom([3/2, -n], [3], -2). - Peter Luschny, Feb 03 2015
a(n) = 4^n*hypergeom([-n/2, (1-n)/2], [2], 1/4). - Robert Israel, Feb 04 2015
a(n) = Sum_{k=0..n} A108198(n,k)*2^(n-k). - Peter Luschny, Feb 05 2015
a(n) = 2*(12^(n/2))*(n!/(n+2)!)*GegenbauerC(n, 3/2,2/sqrt(3)), where GegenbauerC are Gegenbauer polynomials in Maple notation. This is a consequence of Robert Israel's formula. - Karol A. Penson, Feb 20 2015
a(n) = (2^(n+1)*3^((n+1)/2)*P(n+1,1,2/sqrt(3)))/((n+1)*(n+2)) where P(n,u,x) are the associated Legendre polynomials of the first kind. - Peter Luschny, Feb 24 2015
a(n) = -6^(n+1)*sqrt(3)*Integral{t=0..Pi}(cos(t)*(2+cos(t))^(-n-2))/(Pi*(n+2)). - Peter Luschny, Feb 24 2015
From Karol A. Penson and Wojciech Mlotkowski, Mar 16 2015: (Start)
Integral representation as the n-th moment of a positive function defined on a segment x=[2, 6]. This function is the Wigner's semicircle distribution shifted to the right by 4. This representation is unique. In Maple notation,
a(n) = int(x^n*sqrt(4-(x-4)^2)/(2*Pi), x=2..6),
a(n) = 2*6^n*Pochhammer(3/2, n)*hypergeom([-n, 3/2], [-n-1/2], 1/3)/(n+2)!
(End)
a(n) = GegenbauerC(n, -n-1, -2)/(n+1). - Peter Luschny, May 09 2016
E.g.f.: exp(4*x) * BesselI(1,2*x) / x. - Ilya Gutkovskiy, Jun 01 2020
From Peter Bala, Aug 18 2021: (Start)
G.f. A(x) = 1/(1 - 2*x)*c(x/(1 - 2*x))^2, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. Cf. A129400.
Conjecture: a(n) is even except for n of the form 2*(2^k - 1). [added Feb 03: the conjecture follows from the formula a(n) = Sum_{k = 0..n} 2^(n-k)*binomial(n, k)*Catalan(k+1) given above.] (End)
From Peter Bala, Feb 03 2024: (Start)
G.f.: 1/(1 - 2*x) * c(x/(1 - 2*x))^2 = 1/(1 - 6*x) * c(-x/(1 - 6*x))^2, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108.
a(n) = 6^n * Sum_{k = 0..n} (-6)^(-k)*binomial(n, k)*Catalan(k+1).
a(n) = 6^n * hypergeom([-n, 3/2], [3], 2/3). (End)

Extensions

Additional comments from Michael Somos, Jun 10 2000

A026736 Triangular array T read by rows: T(n,0) = T(n,n) = 1 for n >= 0; for n >= 2 and 1 <= k <= n-1, T(n,k) = T(n-1,k-1) + T(n-2,k-1) + T(n-1,k) if n is even and k=(n-2)/2, otherwise T(n,k) = T(n-1,k-1) + T(n-1,k).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 5, 6, 4, 1, 1, 6, 11, 10, 5, 1, 1, 7, 22, 21, 15, 6, 1, 1, 8, 29, 43, 36, 21, 7, 1, 1, 9, 37, 94, 79, 57, 28, 8, 1, 1, 10, 46, 131, 173, 136, 85, 36, 9, 1, 1, 11, 56, 177, 398, 309, 221, 121, 45, 10, 1, 1, 12, 67, 233, 575, 707, 530, 342, 166, 55, 11, 1
Offset: 0

Views

Author

Keywords

Comments

T(n, k) is the number of paths from (0, 0) to (n-k, k) in directed graph having vertices (i, j) and edges (i, j)-to-(i+1, j) and (i, j)-to-(i, j+1) for i, j >= 0 and edges (i, i+2)-to-(i+1, i+3) for i >= 0.

Examples

			Triangle begins
  1;
  1,  1;
  1,  2,  1;
  1,  3,  3,   1;
  1,  5,  6,   4,   1;
  1,  6, 11,  10,   5,   1;
  1,  7, 22,  21,  15,   6,   1;
  1,  8, 29,  43,  36,  21,   7,   1;
  1,  9, 37,  94,  79,  57,  28,   8,   1;
  1, 10, 46, 131, 173, 136,  85,  36,   9,   1;
  1, 11, 56, 177, 398, 309, 221, 121,  45,  10,   1;
  1, 12, 67, 233, 575, 707, 530, 342, 166,  55,  11,  1;
  ...
		

Crossrefs

Row sums give A026743.
T(2n,n) gives A026737(n) or A111279(n+1).

Programs

  • GAP
    T:= function(n,k)
        if k=0 or k=n then return 1;
        elif (n mod 2)=0 and k=Int((n-2)/2) then return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k);
        else return T(n-1, k-1) + T(n-1, k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Jul 16 2019
  • Mathematica
    T[, 0] = T[n, n_] = 1; T[n_, k_] := T[n, k] = If[EvenQ[n] && k == (n-2)/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 22 2018 *)
  • PARI
    T(n,k) = if(k==n || k==0, 1, if((n%2)==0 && k==(n-2)/2, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) ));
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 16 2019
    
  • Sage
    def T(n, k):
        if (k==0 or k==n): return 1
        elif (mod(n,2)==0 and k==(n-2)/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
        else: return T(n-1, k-1) + T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jul 16 2019
    

Extensions

Offset corrected by Alois P. Heinz, Jul 23 2018

A005700 a(n) = C(n)*C(n+2) - C(n+1)^2 where C() are the Catalan numbers A000108.

Original entry on oeis.org

1, 1, 3, 14, 84, 594, 4719, 40898, 379236, 3711916, 37975756, 403127256, 4415203280, 49671036900, 571947380775, 6721316278650, 80419959684900, 977737404590100, 12058761323277900, 150656212896017400, 1904342169333848400, 24328661192286773400, 313839729380499376860
Offset: 0

Views

Author

Keywords

Comments

The old name was: Number of closed walks of 2n unit steps north, east, south, or west starting and ending at the origin and confined to the first octant.
Image of Catalan numbers (A000108) under "little Hankel" transform that sends [c_0, c_1, ...] to [d_0, d_1, ...] where d_n = c_n^2 - c_{n+1}*c_{n-1}.
The Niederhausen reference counts various classes of first octant paths by number of contacts with the line y=x. - David Callan, Sep 18 2007
In Sloane and Plouffe (1995) this was incorrectly described as "Dyck paths".
Also matchings avoiding a certain pattern (see J. Bloom and S. Elizalde). - N. J. A. Sloane, Jan 02 2013
From Bruce Westbury, Aug 22 2013: (Start)
a(n) is also the number of nested pairs of Dyck paths of length n starting and ending at the origin;
a(n) is also the number of 3-noncrossing perfect matchings on 2n points;
a(n) is also the number of 2-triangulations on n-gon;
a(n) is also the dimension of the invariant subspace of 2n-th tensor power of the spin representation of Spin(5);
a(n) is also the dimension of the invariant subspace of 2n-th tensor power of the defining representation of Sp(4). (End)
a(-1) = -3/2, a(-2) = -1/4 makes some formulas true for all n in Z. - Michael Somos, Oct 02 2014
a(n) is the number of uniquely sorted permutations of length 2n+1 that avoid the pattern 312. - Colin Defant, Jun 08 2019

Examples

			Example: a(2)=3 counts EWEW, EEWW, ENSW.
G.f. = 1 + x + 3*x^2 + 14*x^3 + 84*x^4 + 594*x^5 + 4719*x^6 + 40898*x^7 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A column of the triangle in A179898. A diagonal of the triangle in A185249.
Row sums of A193691, A193692. - Alois P. Heinz, Aug 03 2011
See A138349 for another version.

Programs

  • LiE
    p_tensor(2*n,[0,1],B2)|[0,0]
    
  • LiE
    p_tensor(2*n,[1,0],C2)|[0,0]
    
  • Magma
    [6*Factorial(2*n)*Factorial(2*n+2)/(Factorial(n)*Factorial(n+1)* Factorial(n+2)*Factorial(n+3)): n in [0..25]]; // Vincenzo Librandi, Aug 04 2011
    
  • Mathematica
    CoefficientList[ Series[ HypergeometricPFQ[ {1, 1/2, 3/2}, {3, 4}, 16 x], {x, 0, 19}], x]
    a[ n_] := If[ n < 1, Boole[n == 0], Det[ Table[ Binomial[i + 1, j - i + 2], {i, n}, {j, n}]]]; (* Michael Somos, Feb 25 2014 *) (* slight modification of David Callan formula *)
    a[ n_] := 12 * 4^n * (2*n-1)!! * (2*n+1)!! / ((n+2)! * (n+3)!); (* Michael Somos, Oct 02 2014 *)
  • PARI
    a(n)=6*binomial(2*n+2,n)*(2*n)!/(n+1)!/(n+3)! \\ Charles R Greathouse IV, Aug 04 2011
    
  • PARI
    {a(n) = if( n<0, if( n<-2, 0, [-3/2, -1/4][-n]), 6 * (2*n)! * (2*n+2)! / (n! * (n+1)! * (n+2)! * (n+3)!))}; /* Michael Somos, Oct 02 2014 */

Formula

G.f.: 3F2( [ 1, 1/2, 3/2 ]; [ 3, 4 ]; 16 x ).
a(n) = 6*(2*n)!*(2*n+2)!/(n!*(n+1)!*(n+2)!*(n+3)!) (Mihailovs).
a(n) = Det[Table[binomial[i+1, j-i+2], {i, 1, n}, {j, 1, n}]]. - David Callan, Jul 20 2005
a(n) = b(n)b(n+1)/6 where b(n) is the superballot number A007054. - David Callan, Feb 01 2007
a(n) = A000108(n)*A000108(n+2) - A000108(n+1)^2. - Philippe Deléham, Apr 11 2007
G.f.: (1 + 6*x - hypergeom([-1/2,-3/2],[2],16*x))/(4*x^2). - Mark van Hoeij, Nov 02 2009
From Michael Somos, Oct 02 2014: (Start)
a(n) = 12 * 4^n * (2*n-1)!! * (2*n+1)!! / ((n+2)! * (n+3)!).
D-finite with recurrence 0 = a(n) * 4*(2*n+1)*(2*n+3) - a(n+1) * (n+3)*(n+4) for all n in Z.
0 = a(n)*(+65536*a(n+2) - 72192*a(n+3) + 10296*a(n+4)) + a(n+1)*(-1536*a(n+2) - 1632*a(n+3) - 282*a(n+4)) + a(n+2)*(+40*a(n+2) - 6*a(n+3) + a(n+4)) for all n in Z.
0 = a(n)^2*a(n+2)*(+1792*a(n+1) - 882*a(n+2)) + a(n)*a(n+1)^2*(+768*a(n+1) + 580*a(n+2)) + 7*a(n)*a(n+1)*a(n+2)^2 +a(n+1)^3*(-18*a(n+1) + 3*a(n+2)) for all n in Z. (End)
a(n) ~ 3 * 2^(4*n+3) / (Pi * n^5). - Vaclav Kotesovec, Feb 10 2015
From Peter Bala, Feb 22 2023: (Start)
a(n) = (12*(2*n - 1)/((n + 1)(n + 2)(n + 3))) * Catalan(n-1)*Catalan(n+1) for n >= 1.
a(n) = Product_{1 <= i <= j <= n-1} (i + j + 4)/(i + j).
a(n) = (1/2^(n-1)) * Product_{1 <= i <= j <= n-1} (i + j + 4)/(i + j - 1) for n >= 1. (End)
Sum_{n>=0} a(n)/16^n = 88 - 4096/(15*Pi). - Amiram Eldar, May 06 2023

Extensions

More terms from James Sellers, Dec 24 1999
Corrected by Vladeta Jovovic, May 23 2004
Better definition from David Callan, Sep 18 2007
Definition simplified by N. J. A. Sloane, Nov 30 2020

A002898 Number of n-step closed paths on hexagonal lattice.

Original entry on oeis.org

1, 0, 6, 12, 90, 360, 2040, 10080, 54810, 290640, 1588356, 8676360, 47977776, 266378112, 1488801600, 8355739392, 47104393050, 266482019232, 1512589408044, 8610448069080, 49144928795820, 281164160225520, 1612061452900080, 9261029179733760, 53299490722049520
Offset: 0

Views

Author

Keywords

Comments

Also, number of closed paths of length n on the honeycomb tiling.
The hexagonal lattice is the familiar 2-dimensional lattice in which each point has 6 neighbors. This is sometimes called the triangular lattice.
From David Callan, Aug 25 2009: (Start)
a(n) = number of 2 X n matrices, entries from {1,2,3}, second row a (multiset) permutation of the first, with no constant columns. For example, a(2)=6 counts the matrices
1 2 1 3 2 1 2 3 3 1 3 2
2 1 3 1 1 2 3 2 1 3 2 3. (End)
Also, a(n) is the constant coefficient in the expansion of (x + 1/x + y + 1/y + x/y + y/x)^n. - Christopher J. Smyth, Sep 25 2018
a(n) is the constant term in the expansion of (-2 + (1 + x) * (1 + y) + (1 + 1/x) * (1 + 1/y))^n. - Seiichi Manyama, Oct 27 2019
a(n) is the number of paths from (0,0,0) to (n,n,n) using the six permutations of (0,1,2) as steps, i.e., the steps (0,1,2), (0,2,1), (1,0,2), (1,2,0), (2,0,1), and (2,1,0). - William J. Wang, Dec 07 2020

Examples

			O.g.f.: 1 + 6*x^2 + 12*x^3 + 90*x^4 + 360*x^5 + 2040*x^6 + ...
O.g.f.: 1 + 6*x^2*(1+2*x) + 90*x^4*(1+2*x)^2 + 1680*x^6*(1+2*x)^3 + 34650*x^8*(1+2*x)^4 + ... + A006480(n)*x^(2*n)*(1+2*x)^n + .... - _Paul D. Hanna_, Feb 26 2012
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000172, A006480, A337905-A337907, A094060, A002894 (returns square lattice), A002893 (honeycomb net).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, [1, 0, 6][n+1], ((n-1)*
          n*a(n-1) +24*(n-1)^2*a(n-2) +36*(n-1)*(n-2)*a(n-3))/n^2)
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Dec 08 2020
  • Mathematica
    a[n_] := Sum[(-2)^(n-i)*Binomial[i, j]^3*Binomial[n, i], {i, 0, n}, {j, 0, i}]; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Dec 21 2011, after Vasu Tewari *)
  • PARI
    {a(n)=polcoeff(sum(m=0,n, (3*m)!/m!^3*x^(2*m)*(1+2*x+x*O(x^n))^m),n)} /* Paul D. Hanna, Feb 26 2012 */

Formula

D-finite with recurrence a(0) = 1, a(1) = 0, a(2) = 6, 36*(n+2)*(n+1)*a(n) +24*(n+2)^2*a(n+1) +(n+3)*(n+2)*a(n+2) -(n+3)^2*a(n+3) = 0.
E.g.f.: (BesselI(0,2*x))^3 + 2*Sum_{k>=1} (BesselI(k,2*x))^3. - Karol A. Penson Aug 18 2006
a(n) = Sum_{i=0..n} (-2)^(n-i)*binomial(n, i)*(Sum_{j=0..i} binomial(i, j)^3). - Vasu Tewari (vasu(AT)math.ubc.ca), Aug 04 2010
O.g.f.: (4/Pi)*EllipticK( 8*sqrt(z^3*(1+3*z))/(1-12*z^2+sqrt((1-6*z)*(1+2*z)^3)) ) / sqrt(2 - 24*z^2 + 2*sqrt((1-6*z)*(1+2*z)^3)). - Sergey Perepechko, Feb 08 2011
O.g.f.: Sum_{n>=0} (3*n)!/n!^3 * x^(2*n)*(1+2*x)^n. - Paul D. Hanna, Feb 26 2012
a(n) ~ sqrt(3)*6^n/(2*Pi*n). - Vaclav Kotesovec, Aug 13 2013
O.g.f.: 2F1(1/3,2/3; 1; 27*x^2*(1+2*x)). - R. J. Mathar, Sep 29 2020

Extensions

More terms from David Bloom, Mar 1997
Formula and further terms from Cyril Banderier, Oct 12 2000

A330979 The squares visited on the Ulam Spiral when starting at square 1 and then stepping to the closest unvisited square which contains a prime number. If two or more squares are the same distance from the current square then the one with the smallest prime number is chosen.

Original entry on oeis.org

1, 2, 3, 11, 29, 13, 31, 59, 61, 97, 139, 191, 251, 193, 101, 103, 67, 37, 17, 5, 19, 7, 23, 47, 79, 163, 281, 353, 283, 433, 521, 617, 523, 619, 439, 359, 223, 167, 83, 173, 229, 293, 227, 367, 449, 541, 743, 857, 977, 853
Offset: 1

Views

Author

Scott R. Shannon, Jan 05 2020

Keywords

Comments

The first term at which a step to a non-adjacent square is required is a(9) = 61; the previous square 59 has adjacent squares 31,32,33,58,60,93,94,95 of which only 31 is prime, but 31 has already been visited at a(7).
In the first 10 million terms the longest required step is from a(8165267) = 22147771, which has coordinates (-2353,1019) relative to the starting 1-square, to a(8165268) = 8236981 with coordinates (-1435,1355), a step of length sqrt(955620), approximately 977.6 units. See A331027 for the progression of step length records. If the maximum step distance between adjacent prime terms has a finite value or is unbounded as n increases is unknown. The largest difference between adjacent prime terms is for a(8176270) = 32960287 to a(8176271) = 18983957, a difference of 13976330.
In the first 10 million terms the smallest unvisited prime is 2701871, which has coordinates (44,822) relative to the starting 1-square. The smallest unvisited term is found to slowly increase as the number of steps increases, indicating that eventually all primes will be visited, although this is unknown. It may require an extremely large number of steps before all primes below a certain value are visited due to the decreasing likelihood of the walk taking the long steps required to visit those primes near the origin which were unvisited in earlier steps.

Examples

			a(4) = 11 as a(3) = 3, and in the Ulam Spiral 3 has adjacent surrounding neighbors 1,2,4,11,12,13,14,15. 2 is only 1 unit away but has already been visited. The other closest primes are 11 and 13, both of which are sqrt(2) units away, but 11 is chosen as 11 is less than 13.
		

Crossrefs

Extensions

a(121) and beyond, and associated images, correct by Scott R. Shannon, Feb 02 2020

A001334 Number of n-step self-avoiding walks on hexagonal [ =triangular ] lattice.

Original entry on oeis.org

1, 6, 30, 138, 618, 2730, 11946, 51882, 224130, 964134, 4133166, 17668938, 75355206, 320734686, 1362791250, 5781765582, 24497330322, 103673967882, 438296739594, 1851231376374, 7812439620678, 32944292555934, 138825972053046
Offset: 0

Views

Author

Keywords

Comments

The hexagonal lattice is the familiar 2-dimensional lattice in which each point has 6 neighbors. This is sometimes called the triangular lattice.

References

  • A. J. Guttmann, Asymptotic analysis of power-series expansions, pp. 1-234 of C. Domb and J. L. Lebowitz, editors, Phase Transitions and Critical Phenomena. Vol. 13, Academic Press, NY, 1989.
  • B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 459.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    mo={{2, 0},{-1, 1},{-1, -1},{-2, 0},{1, -1},{1, 1}}; a[0]=1;
    a[tg_, p_:{{0, 0}}] := Block[{e, mv = Complement[Last[p]+# & /@ mo, p]}, If[tg == 1, Length@mv, Sum[a[tg-1, Append[p, e]], {e, mv}]]];
    a /@ Range[0, 6]
    (* Robert FERREOL, Nov 28 2018; after the program of Giovanni Resta in A001411 *)
  • Python
    def add(L,x):
        M=[y for y in L];M.append(x)
        return(M)
    plus=lambda L,M : [x+y for x,y in zip(L,M)]
    mo=[[2,0],[-1,1],[-1, -1],[-2,0],[1,-1],[1, 1]]
    def a(n,P=[[0, 0]]):
        if n==0: return(1)
        mv1 = [plus(P[-1],x) for x in mo]
        mv2=[x for x in mv1 if x not in P]
        if n==1: return(len(mv2))
        else: return(sum(a(n-1,add(P,x)) for x in mv2))
    [a(n) for n in range(11)]
    # Robert FERREOL, Dec 11 2018

A054878 Number of closed walks of length n along the edges of a tetrahedron based at a vertex.

Original entry on oeis.org

1, 0, 3, 6, 21, 60, 183, 546, 1641, 4920, 14763, 44286, 132861, 398580, 1195743, 3587226, 10761681, 32285040, 96855123, 290565366, 871696101, 2615088300, 7845264903, 23535794706, 70607384121, 211822152360, 635466457083
Offset: 0

Views

Author

Paolo Dominici (pl.dm(AT)libero.it), May 23 2000

Keywords

Comments

Number of closed walks of length n at a vertex of C_4, the cyclic graph on 4 nodes. 3*A015518(n) + a(n) = 3^n. - Paul Barry, Feb 03 2004
Form the digraph with matrix A = [0,1,1,1; 1,0,1,1; 1,1,0,1; 1,0,1,1]; a(n) corresponds to the (1,1) term of A^n. - Paul Barry, Oct 02 2004
Absolute values of A084567 (compare generating functions).
For n > 1, 4*a(n)=A218034(n)= the trace of the n-th power of the adjacency matrix for a complete 4-graph, a 4 X 4 matrix with a null diagonal and all ones for off-diagonal elements. The diagonal elements for the n-th power are a(n) and the off-diagonal are a(n)+1 for an odd power and a(n)-1 for an even (cf. A001045). - Tom Copeland, Nov 06 2012

Crossrefs

Row n=4 of A109502. A084567 (signed version).
{a(n)/3} for n>0 is A015518, non-closed walks.
Cf. A001045, A078008, A097073, A115341, A015518 (sequences where a(n)=3^n-a(n-1)). - Vladimir Joseph Stephan Orlovsky, Dec 11 2008

Programs

  • Magma
    [(3^n+(-1)^n*3)/4: n in [0..35]]; // Vincenzo Librandi, Jun 30 2011
    
  • Maple
    A054878:=n->(3^n + (-1)^n*3)/4: seq(A054878(n), n=0..50); # Wesley Ivan Hurt, Sep 16 2017
  • Mathematica
    Table[(3^n + (-1)^n*3)/4, {n, 0, 26}] (* or *)
    CoefficientList[Series[1/4*(3/(1 + x) + 1/(1 - 3 x)), {x, 0, 26}], x] (* Michael De Vlieger, Sep 15 2017 *)
  • PARI
    a(n) = (3^n + 3*(-1)^n)/4; \\ Altug Alkan, Sep 17 2017

Formula

a(n) = (3^n + (-1)^n*3)/4.
G.f.: 1/4*(3/(1+x) + 1/(1-3*x)).
E.g.f.: (exp(3*x) + 3*exp(-x))/4. - Paul Barry, Apr 20 2003
a(n) = 3^n - a(n-1) with a(0)=0. - Labos Elemer, Apr 26 2003
G.f.: (1 - 3*x^2 - 2*x^3)/(1 - 6*x^2 - 8*x^3 - 3*x^4) = (1 - 3*x^2 - 2*x^3)/charpoly(adj(C_4)). - Paul Barry, Feb 03 2004
From Paul Barry, Oct 02 2004: (Start)
G.f.: (1-2*x)/(1 - 2*x - 3*x^2).
a(n) = 2*a(n-1) + 3*a(n-2). (End)
G.f.: 1 - x + x/Q(0), where Q(k) = 1 + 3*x^2 - (3*k+4)*x + x*(3*k+1 - 3*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 07 2013
a(n+m) = a(n)*a(m) + a(n+1)*a(m+1)/3. - Yuchun Ji, Sep 12 2017
a(n) = 3*a(n-1) + 3*(-1)^n. - Yuchun Ji, Sep 13 2017
From Peter Bala, May 28 2024: (Start)
a(n) = (-1)^n + Sum_{k = 1..n} (-1)^(n-k)*binomial(n, k)*4^(k-1).
G.f.: A(x) = 1/(1 - x^2) o 1/(1 - x^2), where o denotes the black diamond product of power series as defined by Dukes and White. Cf. A015575.
The black diamond product A(x) o A(x) is the g.f. for the number of closed walks of length n at a vertex along the edges of the 15-simplex. (End)
Previous Showing 21-30 of 4476 results. Next