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.

Showing 1-10 of 23 results. Next

A063886 Number of n-step walks on a line starting from the origin but not returning to it.

Original entry on oeis.org

1, 2, 2, 4, 6, 12, 20, 40, 70, 140, 252, 504, 924, 1848, 3432, 6864, 12870, 25740, 48620, 97240, 184756, 369512, 705432, 1410864, 2704156, 5408312, 10400600, 20801200, 40116600, 80233200, 155117520, 310235040, 601080390, 1202160780, 2333606220, 4667212440
Offset: 0

Views

Author

Henry Bottomley, Aug 28 2001

Keywords

Comments

A Chebyshev transform of A007877(n+1). The g.f. is transformed to (1+x)/((1-x)(1+x^2)) under the mapping G(x)->(1/(1+x^2))G(1/(1+x^2)). - Paul Barry, Oct 12 2004
a(n-1) = 2*C(n-2, floor((n-2)/2)) is also the number of bit strings of length n in which the number of 00 substrings is equal to the number of 11 substrings. For example, when n = 4 we have 4 such bit strings: 0011, 0101, 1010, and 1100. - Angel Plaza, Apr 23 2009
Hankel transform is A120617. - Paul Barry, Aug 10 2009
The Hankel transform of a(n) is (-2)^C(n+1,2). The Hankel transform of (-1)^C(n+1,2)*a(n) is (-1)^C(n+1,2)*A164584(n). - Paul Barry, Aug 17 2009
For n > 1, a(n) is also the number of n-step walks starting from the origin and returning to it exactly once. - Geoffrey Critzer, Jan 24 2010
-a(n) is the Z-sequence for the Riordan array A130777. (See the W. Lang link under A006232 for A- and Z-sequences for Riordan matrices). - Wolfdieter Lang, Jul 12 2011
Number of subsets of {1,...,n} in which the even elements appear as often at even positions as at odd positions. - Gus Wiseman, Mar 17 2018

Examples

			a(4) = 6 because there are six length four walks that do not return to the origin: {-1, -2, -3, -4}, {-1, -2, -3, -2}, {-1, -2, -1, -2}, {1, 2, 1, 2}, {1, 2, 3, 2}, {1, 2, 3, 4}. There are also six such walks that return exactly one time: {-1, -2, -1, 0}, {-1, 0, -1, -2}, {-1, 0, 1, 2}, {1, 0, -1, -2}, {1, 0, 1, 2}, {1, 2, 1, 0}. - _Geoffrey Critzer_, Jan 24 2010
The a(5) = 12 subsets in which the even elements appear as often at even positions as at odd positions: {}, {1}, {3}, {5}, {1,3}, {1,5}, {2,4}, {3,5}, {1,2,4}, {1,3,5}, {2,4,5}, {1,2,4,5}. - _Gus Wiseman_, Mar 17 2018
		

Crossrefs

Programs

  • Magma
    [1] cat [2*Binomial(n-1, Floor((n-1)/2)): n in [1..40]]; // G. C. Greubel, Jun 07 2023
    
  • Maple
    seq(seq(binomial(2*j,j)*i, i=1..2),j=0..16); # Zerinvary Lajos, Apr 28 2007
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n+1,
           4*a(n-2) +2*(a(n-1) -4*a(n-2))/n)
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 10 2014
    # third program:
    A063886 := series(BesselI(0, 2*x)*(1 + x*2 + x*Pi*StruveL(1, 2*x)) - Pi*x*BesselI(1, 2*x)*StruveL(0, 2*x), x = 0, 34): seq(n!*coeff(A063886, x, n), n = 0 .. 33); # Mélika Tebni, Jun 17 2024
  • Mathematica
    Table[Length[Select[Map[Accumulate, Strings[{-1, 1}, n]], Count[ #, 0] == 0 &]], {n, 0, 20}] (* Geoffrey Critzer, Jan 24 2010 *)
    CoefficientList[Series[Sqrt[(1+2x)/(1-2x)],{x,0,40}],x] (* Harvey P. Dale, Apr 28 2016 *)
  • PARI
    a(n)=(n==0)+2*binomial(n-1,(n-1)\2)
    
  • PARI
    a(n) = 2^n*prod(k=0,n-1,(k/n+1/n)^((-1)^k)); \\ Michel Marcus, Dec 03 2013
    
  • Python
    from math import ceil
    from sympy import binomial
    def a(n):
        if n==0: return 1
        return 2*binomial(n-1,(n-1)//2)
    print([a(n) for n in range(18)])
    # David Nacin, Feb 29 2012
    
  • SageMath
    [2*binomial(n-1, (n-1)//2) + int(n==0) for n in range(41)] # G. C. Greubel, Jun 07 2023

Formula

G.f.: sqrt((1+2*x)/(1-2*x)).
a(n+1) = 2*C(n, floor(n/2)) = 2*A001405(n); a(2n) = C(2n, n) = A000984(n) = 4*a(2n-2)-|A002420(n)| = 4*a(2n-2)-2*A000108(n-1) = 2*A001700(n-1); a(2n+1) = 2*a(2n) = A028329(n).
2*a(n) = A047073(n+1).
a(n) = Sum_{k=0..n} abs(A106180(n,k)). - Philippe Deléham, Oct 06 2006
a(n) = Sum_{k=0..n} (k+1)binomial(n, (n-k)/2) ( 1-cos((k+1)*Pi/2) (1+(-1)^(n-k))/(n+k+2) ). - Paul Barry, Oct 12 2004
G.f.: 1/(1-2*x/(1+x/(1+x/(1-x/(1-x/(1+x/(1+x/(1-x/(1-x/(1+ ... (continued fraction). - Paul Barry, Aug 10 2009
G.f.: 1 + 2*x/(G(0)-x+x^2) where G(k)= 1 - 2*x^2 - x^4/G(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Aug 10 2012
D-finite with recurrence: n*a(n) = 2*a(n-1) + 4*(n-2)*a(n-2). - R. J. Mathar, Dec 03 2012
From Sergei N. Gladkovskii, Jul 26 2013: (Start)
G.f.: 1/G(0), where G(k) = 1 - 2*x/(1 + 2*x/(1 + 1/G(k+1) )); (continued fraction).
G.f.: G(0), where G(k) = 1 + 2*x/(1 - 2*x/(1 + 1/G(k+1) )); (continued fraction).
G.f.: W(0)/2*(1+2*x), where W(k) = 1 + 1/(1 - 2*x/(2*x + (k+1)/(x*(2*k+1))/W(k+1) )), abs(x) < 1/2; (continued fraction). (End)
a(n) = 2^n*Product_{k=0..n-1} (k/n + 1/n)^((-1)^k). - Peter Luschny, Dec 02 2013
G.f.: G(0), where G(k) = 1 + 2*x*(4*k+1)/((2*k+1)*(1+2*x) - (2*k+1)*(4*k+3)*x*(1+2*x)/((4*k+3)*x + (k+1)*(1+2*x)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 19 2014
From Peter Bala, Mar 29 2024: (Start)
a(n) = 2^n * Sum_{k = 0..n} (-1)^(n+k)*binomial(1/2, k)*binomial(- 1/2, n-k) = 2^n * A000246(n)/n!.
a(n) = (1/2^n) * binomial(2*n, n) * hypergeom([-1/2, -n], [1/2 - n], -1). (End)
E.g.f.: BesselI(0, 2*x)*(1 + x*(2 + Pi)*StruveL(1, 2*x)) - Pi*x*BesselI(1, 2*x)*StruveL(0, 2*x). - Stefano Spezia, May 11 2024
a(n) = A089849(n) + A138364(n). - Mélika Tebni, Jun 17 2024
From Amiram Eldar, Aug 15 2025: (Start)
Sum_{n>=0} 1/a(n) = Pi/(3*sqrt(3)) + 2.
Sum_{n>=0} (-1)^n/a(n) = 2/3 + Pi/(9*sqrt(3)). (End)

A095660 Pascal (1,3) triangle.

Original entry on oeis.org

3, 1, 3, 1, 4, 3, 1, 5, 7, 3, 1, 6, 12, 10, 3, 1, 7, 18, 22, 13, 3, 1, 8, 25, 40, 35, 16, 3, 1, 9, 33, 65, 75, 51, 19, 3, 1, 10, 42, 98, 140, 126, 70, 22, 3, 1, 11, 52, 140, 238, 266, 196, 92, 25, 3, 1, 12, 63, 192, 378, 504, 462, 288, 117, 28, 3, 1, 13, 75, 255, 570, 882, 966, 750, 405, 145, 31, 3
Offset: 0

Views

Author

Wolfdieter Lang, May 21 2004

Keywords

Comments

This is the third member, q=3, in the family of (1,q) Pascal triangles: A007318 (Pascal (q=1)), A029635 (q=2) (but with T(0,0)=2, not 1).
This is an example of a Riordan triangle (see A053121 for a comment and the 1991 Shapiro et al. reference on the Riordan group) with o.g.f. of column no. m of the type g(x)*(x*f(x))^m with f(0)=1. Therefore the o.g.f. for the row polynomials p(n,x) = Sum_{m=0..n} T(n,m)*x^m is G(z,x) = g(z)/(1-x*z*f(z)). Here: g(x) = (3-2*x)/(1-x), f(x) = 1/(1-x), hence G(z,x) = (3-2*z)/(1-(1+x)*z).
The SW-NE diagonals give Sum_{k=0..ceiling((n-1)/2)} T(n-1-k,k) = A000285(n-2), n>=2, with n=1 value 3. Observation by Paul Barry, Apr 29 2004. Proof via recursion relations and comparison of inputs.
Central terms: T(2*n,n) = A028329(n) = A100320(n) for n > 0, A028329 are the central terms of triangle A028326. - Reinhard Zumkeller, Apr 08 2012
Let P be Pascal's triangle, A007318 and R the Riordan array, A097805. Then Pascal triangle (1,q) = ((q-1) * R) + P. Example: Pascal triangle (1,3) = (2 * R) + P. - Gary W. Adamson, Sep 12 2015

Examples

			Triangle starts:
  3;
  1,  3;
  1,  4,  3;
  1,  5,  7,   3;
  1,  6, 12,  10,   3;
  1,  7, 18,  22,  13,   3;
  1,  8, 25,  40,  35,  16,   3;
  1,  9, 33,  65,  75,  51,  19,   3;
  1, 10, 42,  98, 140, 126,  70,  22,   3;
  1, 11, 52, 140, 238, 266, 196,  92,  25,   3;
  1, 12, 63, 192, 378, 504, 462, 288, 117,  28,  3;
  1, 13, 75, 255, 570, 882, 966, 750, 405, 145, 31, 3;
		

Crossrefs

Row sums: A000079(n+1), n>=1, 3 if n=0. Alternating row sums are [3, -2, followed by 0's].
Column sequences (without leading zeros) give for m=1..9 with n>=0: A000027(n+3), A055998(n+1), A006503(n+1), A095661, A000574, A095662, A095663, A095664, A095665.
Cf. A097805.

Programs

  • Haskell
    a095660 n k = a095660_tabl !! n !! k
    a095660_row n = a095660_tabl !! n
    a095660_tabl = [3] : iterate
       (\row -> zipWith (+) ([0] ++ row) (row ++ [0])) [1,3]
    -- Reinhard Zumkeller, Apr 08 2012
    
  • Magma
    A095660:= func< n,k | n eq 0 select 3 else (1+2*k/n)*Binomial(n,k) >;
    [A095660(n,k): k in [0..n], n in [1..12]]; // G. C. Greubel, May 02 2021
    
  • Maple
    T(n,k):=piecewise(n=0,3,0Mircea Merca, Apr 08 2012
  • Mathematica
    {3}~Join~Table[(1 + 2 k/n) Binomial[n, k], {n, 11}, {k, 0, n}] // Flatten (* Michael De Vlieger, Sep 14 2015 *)
  • Sage
    def A095660(n,k): return 3 if n==0 else (1+2*k/n)*binomial(n,k)
    flatten([[A095660(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 02 2021

Formula

Recursion: T(n, m)=0 if m>n, T(0, 0)= 3; T(n, 0)=1 if n>=1; T(n, m) = T(n-1, m) + T(n-1, m-1).
G.f. column m (without leading zeros): (3-2*x)/(1-x)^(m+1), m>=0.
T(n,k) = (1+2*k/n) * binomial(n,k), for n>0. - Mircea Merca, Apr 08 2012
Closed-form formula for arbitrary left and right borders of Pascal like triangle see A228196. - Boris Putievskiy, Aug 19 2013

A162551 a(n) = 2 * C(2*n,n-1).

Original entry on oeis.org

0, 2, 8, 30, 112, 420, 1584, 6006, 22880, 87516, 335920, 1293292, 4992288, 19315400, 74884320, 290845350, 1131445440, 4407922860, 17194993200, 67156001220, 262564816800, 1027583214840, 4025232800160, 15780742227900, 61915399071552
Offset: 0

Views

Author

Keywords

Comments

Total length of all Dyck paths of length 2n.
a(n) equals the diagonal element A(n,n) of matrix A whose element A(i,j) = A(i-1,j) + A(i,j-1). - Carmine Suriano, May 10 2010
a(n) is also the number of solid (3 dimensions) standard Young tableaux of shape [[n,n],[1]]. - Thotsaporn Thanatipanonda, Feb 27 2012
With offset = 1, a(n) is the total number of nodes over all binary trees with one child internal and one child external. - Geoffrey Critzer, Feb 23 2013
Central terms of the triangle in A051601. - Reinhard Zumkeller, Aug 05 2013
a(n) is the number of North-East paths from (0,0) to (n+1,n+1) that bounce off the diagonal y = x an odd number of times. Details can be found in Section 4.2 in Pan and Remmel's link. - Ran Pan, Feb 01 2016
a(n) is the number of North-East paths from (0,0) to (n+1,n+1) that cross the diagonal y = x an odd number of times. Details can be found in Section 4.3 in Pan and Remmel's link. - Ran Pan, Feb 01 2016

References

  • R. Sedgewick and P. Flajolet, Analysis of Algorithms, Addison Wesley 1996, page 141.

Crossrefs

Programs

Formula

a(n) = 2*A001791(n). - R. J. Mathar, Jul 15 2009
E.g.f.: exp(2*x)*2*(BesselI(1,2*x)). - Peter Luschny, Aug 26 2012
O.g.f.: ((1 - 2*x)/(1 - 4*x)^(1/2) - 1)/x - Geoffrey Critzer, Feb 23 2013
E.g.f.: 2*Q(0) - 2, where Q(k) = 1 - 2*x/(k + 1 - (k + 1)*(2*k + 3)/(2*k + 3 - (k + 2)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 28 2013
a(n) = binomial(2*n+2, n+1) - A028329(n). - Ran Pan, Feb 01 2016

A189498 T(n,k)=Number of arrangements of n+1 nonzero numbers x(i) in -k..k with the sum of floor(x(i)/x(i+1)) equal to zero.

Original entry on oeis.org

0, 2, 4, 6, 12, 0, 12, 38, 42, 12, 20, 78, 152, 136, 0, 30, 148, 462, 928, 550, 40, 42, 240, 1088, 3388, 4920, 1892, 0, 56, 380, 2128, 9394, 24806, 27508, 7384, 140, 72, 554, 3850, 22088, 85480, 182634, 152358, 26816, 0, 90, 788, 6474, 45892, 238836, 787412
Offset: 1

Views

Author

R. H. Hardin Apr 23 2011

Keywords

Comments

Table starts
...0......2........6........12.........20..........30...........42...........56
...4.....12.......38........78........148.........240..........380..........554
...0.....42......152.......462.......1088........2128.........3850.........6474
..12....136......928......3388.......9394.......22088........45892........86416
...0....550.....4920.....24806......85480......238836.......567774......1218778
..40...1892....27508....182634.....787412.....2642358......7269852.....17692662
...0...7384...152358...1350418....7250142....29261538.....93830584....260746932
.140..26816...852940..10077438...67449574...326423068...1218634086...3870426602
...0.103288..4796962..75593372..630466648..3664621084..15936391068..57837221756
.504.386928.27117826.569975518.5926141678.41363200538.209537582772.869215927390

Examples

			Some solutions for n=7 k=5
.-5...-5...-5...-5...-5...-4...-5...-5...-5...-4...-5...-5...-5...-5...-5...-5
.-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5
..3...-4....5....2....3...-4....4...-4...-3...-5....5....5....1....1....3....3
.-4....3...-4...-3....2...-3....3....5....1...-3...-4....2....4....2....1....2
.-2....2...-1...-4...-1...-5....1....4....1...-4...-2...-5....2....2...-1....5
..4....5...-3....4...-5...-2...-2....3....2...-5....2....3...-5...-4...-5...-5
..3...-2....2....2...-4....5...-4...-1....2....3....3....5...-5...-1....3...-2
..5...-1....5....1...-4...-2....3...-4...-4....4....3....5...-2...-4....3....2
		

Crossrefs

Column 1 is A028329(n/2) for even n
Row 1 is A002378(n-1)

A189545 T(n,k)=Number of arrangements of n+1 nonzero numbers x(i) in -k..k with the sum of trunc(x(i)/x(i+1)) equal to zero.

Original entry on oeis.org

0, 4, 4, 12, 8, 0, 24, 28, 44, 12, 40, 72, 192, 152, 0, 60, 152, 544, 964, 552, 40, 84, 264, 1340, 3664, 5416, 2000, 0, 112, 432, 2520, 11276, 26804, 31280, 7628, 140, 144, 660, 4620, 26152, 97836, 204544, 173792, 28440, 0, 180, 968, 7716, 56440, 274132, 911144
Offset: 1

Views

Author

R. H. Hardin Apr 23 2011

Keywords

Comments

Table starts
...0......4.......12........24.........40..........60...........84
...4......8.......28........72........152.........264..........432
...0.....44......192.......544.......1340........2520.........4620
..12....152......964......3664......11276.......26152........56440
...0....552.....5416.....26804......97836......274132.......683144
..40...2000....31280....204544.....911144.....3022220......8655424
...0...7628...173792...1526520....8485264....33638540....111406336
.140..28440...977092..11544464...80270588...379997096...1456853916
...0.108792..5562216..87396896..762015216..4324466328..19269747584
.504.411888.31839976.665272176.7245223968.49387377504.256327259704

Examples

			Some solutions for n=7 k=5
.-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-4...-5
.-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5...-5
..1...-2...-2...-1....1...-5...-3....4....3...-4....3...-3....3....1...-4....3
..4....4....2...-3...-3....2....5...-1....5....4...-2....4....5...-1....3....3
..1...-1....3....2...-2...-3...-2....5...-5....3....3...-1....4...-2....4....3
.-3...-1...-1...-1...-3....1....5....2...-2....5....5....4....5...-5....3...-4
.-4....4...-1....3...-1...-3...-3....1....5...-2...-5....5....5...-1....4....5
..5....5....4...-1...-2...-1...-3....4...-4...-5...-2....2...-2....3...-3...-2
		

Crossrefs

Column 1 is A028329(n/2) for even n
Row 1 is A046092(n-1)

A190071 T(n,k)=Number of arrangements of n+1 nonzero numbers x(i) in -k..k with the sum of div(x(i),x(i+1)), where div(a,b)=a/b produces the integer quotient implying a nonnegative remainder, equal to zero.

Original entry on oeis.org

0, 2, 4, 6, 12, 0, 12, 36, 40, 12, 20, 76, 166, 144, 0, 30, 143, 483, 922, 550, 40, 42, 233, 1126, 3481, 5136, 1896, 0, 56, 366, 2276, 9904, 25306, 28656, 7584, 140, 72, 536, 4150, 23400, 88509, 191456, 162028, 27328, 0, 90, 760, 6946, 48491, 249119, 834717
Offset: 1

Views

Author

R. H. Hardin May 04 2011

Keywords

Comments

Table starts
...0......2........6........12.........20..........30...........42...........56
...4.....12.......36........76........143.........233..........366..........536
...0.....40......166.......483.......1126........2276.........4150.........6946
..12....144......922......3481.......9904.......23400........48491........92478
...0....550.....5136.....25306......88509......249119.......599181......1291797
..40...1896....28656....191456.....834717.....2783714......7737762.....18951546
...0...7584...162028...1436962....7843113....31391655....101530262....282859251
.140..27328...910716..10802667...73725405...353856100...1333341624...4232955454
...0.105348..5162308..81709584..697624797..4017545773..17643516841..63898862902
.504.398760.29554964.622881909.6644826507.45918810745.235162515839.972408511316

Examples

			Some solutions for n=6 k=4
.-3...-4....2....1....3...-3...-4....1....2...-1...-3....2...-1....1....2...-2
.-1...-4...-4...-3...-2...-2...-2...-2...-3...-1...-1...-1...-2...-2...-3...-4
..3....2....1....2....4....1....4...-2...-2...-3....1....3...-3....3...-2...-2
.-1....2....1....4....2...-2...-3....2....4....1....2....3...-2....1...-3....1
.-1....4...-2....3...-1....3....3...-4...-1....2....3...-4....2...-2....2....3
..4....3...-1....4...-3....2....3...-4...-4....2...-4...-4...-1....3....4....2
..3...-2...-1....3...-3...-3....4....4...-3....4....3...-4....1...-3...-3...-1
		

Crossrefs

Column 1 is A028329(n/2) for even n
Row 1 is A002378(n-1)

A028326 Twice Pascal's triangle A007318: T(n,k) = 2*C(n,k).

Original entry on oeis.org

2, 2, 2, 2, 4, 2, 2, 6, 6, 2, 2, 8, 12, 8, 2, 2, 10, 20, 20, 10, 2, 2, 12, 30, 40, 30, 12, 2, 2, 14, 42, 70, 70, 42, 14, 2, 2, 16, 56, 112, 140, 112, 56, 16, 2, 2, 18, 72, 168, 252, 252, 168, 72, 18, 2, 2, 20, 90, 240, 420, 504, 420, 240, 90, 20, 2, 2, 22, 110, 330, 660, 924, 924, 660, 330, 110, 22, 2
Offset: 0

Views

Author

Keywords

Comments

Also number of binary vectors of length n+1 with k+1 runs (1 <= k <= n).
If the last two entries in each row are removed and 0 replaces the entries in a checkerboard pattern, we obtain
2;
0, 6;
2, 0, 12;
0, 10, 0, 20;
2, 0, 30, 0, 30;
0, 14, 0, 70, 0, 42;
2, 0, 56, 0, 140, 0, 56;
0, 18, 0, 168, 0, 252, 0, 72;
...
This plays the same role of recurrence coefficients for second differences of polynomials as triangle A074909 plays for the first differences. - R. J. Mathar, Jul 03 2013
From Roger Ford, Jul 06 2023: (Start)
T(n,k) = the number of closed meanders with n top arches, n+1 exterior arches and with k = the number of arches of length 1 - (n+1).
Example of closed meanders with 4 top arches and 5 exterior arches:
exterior arches are top arches or bottom arches without a covering arch
/\ = top arch length 1, \/ = bottom arch length 1
/ \ Top: /\=3 / \ / \ Top: /\=2
/\ / /\ \ /\ / /\ \ / /\ \
\ \/ / \ \/ / Bottom: \/=2 \/ \ \/ / \/ Bottom: /\=3
\/ \/ k=5-5=0 \/ k=5-5=0 T(4,0) = 2
/ \ Top: /\=3 / \ Top: /\=3
/\ / /\ /\ \ / /\ \ /\ /\
\ \/ / \/ \/ Bottom: \/=3 \/ \ \/ \/ / Bottom: \/=3
\/ k=6-5=1 \____/ k=6-5=1
/ \ Top: /\=3 / \ Top: /\=3
/ /\ /\ \ /\ /\ /\ / /\ \
\/ \/ \ \/ / Bottom: \/=3 \ \/ \/ / \/ Bottom: \/=3
\/ k=6-5=1 \____/ k=6-5=1 T(4,1) = 4
/ \ Top: /\=3
/ /\ /\ /\ \ /\ /\ /\ /\ Top: /\=4
\/ \/ \/ \/ Bottom: \/=4 \ \/ \/ \/ / Bottom: ||=3
k=7-5=2 \________/ k=7-5=2 T(4,2) = 2.
(End)

Examples

			Triangle begins:
  2;
  2,  2;
  2,  4,   2;
  2,  6,   6,   2;
  2,  8,  12,   8,   2;
  2, 10,  20,  20,  10,    2;
  2, 12,  30,  40,  30,   12,    2;
  2, 14,  42,  70,  70,   42,   14,    2;
  2, 16,  56, 112, 140,  112,   56,   16,   2;
  2, 18,  72, 168, 252,  252,  168,   72,  18,   2;
  2, 20,  90, 240, 420,  504,  420,  240,  90,  20,   2;
  2, 22, 110, 330, 660,  924,  924,  660, 330, 110,  22,  2;
  2, 24, 132, 440, 990, 1584, 1848, 1584, 990, 440, 132, 24, 2;
		

References

  • I. Goulden and D. Jackson, Combinatorial Enumeration, John Wiley and Sons, 1983, page 76.

Crossrefs

Programs

  • Haskell
    a028326 n k = a028326_tabl !! n !! k
    a028326_row n = a028326_tabl !! n
    a028326_tabl = iterate
       (\row -> zipWith (+) ([0] ++ row) (row ++ [0])) [2]
    -- Reinhard Zumkeller, Mar 12 2012
    
  • Magma
    [2*Binomial(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Apr 27 2021
    
  • Maple
    T := proc(n, k) if k=0 then 2 elif k>n then 0 else T(n-1, k)+T(n-1, k-1) fi end:
    for n from 0 to 13 do seq(T(n, k), k=0..n) od; # Zerinvary Lajos, Dec 16 2006
  • Mathematica
    Table[2*Binomial[n, k], {n, 0, 11}, {k, 0, n}]//Flatten (* Robert G. Wilson v, Mar 05 2012 *)
  • PARI
    T(n,k) = 2*binomial(n,k) \\ Charles R Greathouse IV, Feb 07 2017
    
  • Python
    from sympy import binomial
    def T(n, k):
        return 2*binomial(n, k)
    for n in range(21): print([T(n, k) for k in range(n + 1)]) # Indranil Ghosh, Apr 29 2017
    
  • Sage
    flatten([[2*binomial(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Apr 27 2021

Formula

G.f. for the number of length n binary words with k runs: (1-x+x*y)/(1-x-x*y) [Goulden and Jackson]. - Geoffrey Critzer, Mar 04 2012

Extensions

More terms from Donald Manchester, Jr. (s1199170(AT)cedarnet.cedarville.edu)

A241477 Triangle read by rows, number of orbitals classified with respect to the first zero crossing, n>=1, 1<=k<=n.

Original entry on oeis.org

1, 0, 2, 2, 2, 2, 0, 4, 0, 2, 6, 12, 4, 2, 6, 0, 12, 0, 4, 0, 4, 20, 60, 12, 12, 12, 4, 20, 0, 40, 0, 12, 0, 8, 0, 10, 70, 280, 40, 60, 36, 24, 40, 10, 70, 0, 140, 0, 40, 0, 24, 0, 20, 0, 28, 252, 1260, 140, 280, 120, 120, 120, 60, 140, 28, 252, 0, 504, 0
Offset: 1

Views

Author

Peter Luschny, Apr 23 2014

Keywords

Comments

For the combinatorial definitions see A232500. An orbital w over n sectors has its first zero crossing at k if k is the smallest j such that the partial sum(1<=i<=j, w(i))) = 0, where w(i) are the jumps of the orbital represented by -1, 0, 1.

Examples

			[1], [ 1]
[2], [ 0,  2]
[3], [ 2,  2,  2]
[4], [ 0,  4,  0,  2]
[5], [ 6, 12,  4,  2,  6]
[6], [ 0, 12,  0,  4,  0, 4]
[7], [20, 60, 12, 12, 12, 4, 20]
		

Crossrefs

Row sums: A056040.
Cf. A232500.

Programs

  • Maple
    A241477 := proc(n, k)
      if n = 0 then 1
    elif k = 0 then 0
    elif irem(n, 2) = 0 and irem(k, 2) = 1 then 0
    elif k = 1 then (n-1)!/iquo(n-1,2)!^2
    else 2*(n-k)!*(k-2)!/iquo(k,2)/(iquo(k-2,2)!*iquo(n-k,2)!)^2
      fi end:
    for n from 1 to 9 do seq(A241477(n, k), k=1..n) od;
  • Mathematica
    T[n_, k_] := Which[n == 0, 1, k == 0, 0, Mod[n, 2] == 0 && Mod[k, 2] == 1,  0, k == 1, (n-1)!/Quotient[n-1, 2]!^2, True, 2*(n-k)!*(k-2)!/Quotient[k, 2]/(Quotient[k-2, 2]!*Quotient[n-k, 2]!)^2];
    Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 20 2018, from Maple *)
  • Sage
    def A241477_row(n):
        if n == 0: return [1]
        Z = [0]*n; T = [0] if is_odd(n) else []
        for i in (1..n//2): T.append(-1); T.append(1)
        for p in Permutations(T):
            i = 0; s = p[0]
            while s != 0: i += 1; s += p[i];
            Z[i] += 1
        return Z
    for n in (1..9): A241477_row(n)

Formula

If n is even and k is odd then T(n, k) = 0 else if k = 1 then T(n, 1) = A056040(n-1) else T(n, k) = 2*A057977(k-2)*A056040(n-k).
T(n, n) = A241543(n).
T(n+1, 1) = A126869(n).
T(2*n, 2*n) = |A002420(n)|.
T(2*n+1, 1) = A000984(n).
T(2*n+1, n+1) = A241530(n).
T(2*n+2, 2) = A028329(n).
T(4*n, 2*n) = |A010370(n)|.
T(4*n, 4*n) = |A024491(n)|.
T(4*n+1, 1) = A001448(n).
T(4*n+1, 2*n+1) = A002894(n).

A100320 A Catalan transform of (1 + 2*x)/(1 - 2*x).

Original entry on oeis.org

1, 4, 12, 40, 140, 504, 1848, 6864, 25740, 97240, 369512, 1410864, 5408312, 20801200, 80233200, 310235040, 1202160780, 4667212440, 18150270600, 70690527600, 275693057640, 1076515748880, 4208197927440, 16466861455200, 64495207366200, 252821212875504, 991837065896208
Offset: 0

Views

Author

Paul Barry, Nov 14 2004

Keywords

Comments

A Catalan transform of (1 + 2*x)/(1 - 2*x) under the mapping g(x) -> g(x*c(x)). (Here c(x) is the g.f. of A000108.) The original sequence can be retrieved by g(x) -> g(x*(1-x)).
Hankel transform is A144704. - Paul Barry, Sep 19 2008
Central terms of the triangle in A124927. - Reinhard Zumkeller, Mar 04 2012

Crossrefs

Programs

Formula

G.f.: (1 + 2*x*c(x))/(1 - 2*x*c(x)), where c(x) is the g.f. of A000108.
a(n) = 4*binomial(2*n-1, n) - 3*0^n.
a(n) = binomial(2*n, n)*(4*2^(n-1) - 0^n)/2^n.
a(n) = Sum_{j=0..n} Sum_{k=0..n} C(2*n, n-k)*((2*k + 1)/(n + k + 1))*C(k, j)*(-1)^(j-k)*(4*2^(j-1) - 0^j).
a(n) = A028329(n), n > 0. - R. J. Mathar, Sep 02 2008
a(n) = T(2*n,n), where T(n,k) = A132046(n,k). - Paul Barry, Sep 19 2008
a(n) = Sum_{k=0..n} A039599(n,k)*A010684(k). - Philippe Deléham, Oct 29 2008
a(n) = A095660(2*n,n) for n > 0. - Reinhard Zumkeller, Apr 08 2012
G.f.: G(0) - 1, where G(k) = 1 + 1/(1 - 2*x*(2*k + 1)/(2*x*(2*k + 1) + (k + 1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
a(n) = [x^n] (1 + 2*x)/(1 - x)^(n+1). - Ilya Gutkovskiy, Oct 12 2017
a(n) = 2*(2*n-1)*a(n-1)/n. - G. C. Greubel, Feb 01 2023
E.g.f.: 2*exp(2*x)*BesselI(0, 2*x) - 1. - Stefano Spezia, May 11 2024

Extensions

Incorrect connection with A046055 deleted by N. J. A. Sloane, Jul 08 2009

A126966 Expansion of sqrt(1 - 4*x)/(1 - 2*x).

Original entry on oeis.org

1, 0, -2, -8, -26, -80, -244, -752, -2362, -7584, -24892, -83376, -284324, -984672, -3455144, -12259168, -43908026, -158531392, -576352364, -2107982128, -7750490636, -28629222112, -106190978264, -395347083808, -1476813394916, -5533435084480, -20790762971864, -78316232088032
Offset: 0

Views

Author

N. J. A. Sloane, Mar 22 2007

Keywords

Comments

Hankel transform is 2^n*(-1)^binomial(n+1, 2) = A120617(n). - Paul Barry, Feb 08 2008

Crossrefs

Programs

  • GAP
    List([0..30], n-> (-1)*Sum([0..n], j-> 2^j*Binomial(2*(n-j), n-j)/(2*(n-j) -1) )); # G. C. Greubel, Jan 29 2020
  • Magma
    R:=PowerSeriesRing(Rationals(), 30); Coefficients(R!( Sqrt(1-4*x)/(1-2*x) )); // G. C. Greubel, Jan 29 2020
    
  • Maple
    a := n -> -add(2^j*binomial(2*n-2*j,n-j)/(2*n-2*j-1), j=0..n):
    seq(a(n),n=0..30); # Emeric Deutsch, Mar 25 2007
    # second Maple program:
    CatalanNumber := n -> binomial(2*n, n)/(n+1):
    a := n -> 2^n*I + CatalanNumber(n)*simplify(hypergeom([1, n + 1/2], [n + 2], 2)):
    seq(a(n), n=0..26); # Peter Luschny, Aug 04 2020
    # third program:
    A126966 := n -> 2*binomial(2*n, n) - add(2^(n-k)*binomial(2*k,k), k=0..n):
    seq(A126966(n), n = 0 .. 27); # Mélika Tebni, Mar 08 2024
  • Mathematica
    CoefficientList[Series[Sqrt[1-4*x]/(1-2*x), {x,0,30}], x] (* G. C. Greubel, Jan 31 2017 *)
  • PARI
    Vec(sqrt(1-4*x)/(1-2*x) + O(x^30)) \\ G. C. Greubel, Jan 31 2017
    
  • Sage
    def A126966_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( sqrt(1-4*x)/(1-2*x) ).list()
    A126966_list(30) # G. C. Greubel, Jan 29 2020
    

Formula

a(n) = -Sum_{j=0..n} ( 2^j*binomial(2n-2j, n-j)/(2n-2j-1) ). - Emeric Deutsch, Mar 25 2007
D-finite with recurrence: n*a(n) + 6*(1-n)*a(n-1) + 4*(2*n-3)*a(n-2) = 0. - R. J. Mathar, Nov 14 2011, corrected Feb 17 2020
a(n) ~ -4^n/(sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Jun 29 2013
a(n) = 2^n*i + CatalanNumber(n)*hypergeom([1, n + 1/2], [n + 2], 2). - Peter Luschny, Aug 04 2020
a(n) = A028329(n) - A082590(n). - Mélika Tebni, Mar 08 2024
Showing 1-10 of 23 results. Next