%I #73 Jul 15 2024 10:22:24
%S 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,
%T 14,42,70,70,42,14,2,2,16,56,112,140,112,56,16,2,2,18,72,168,252,252,
%U 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
%N Twice Pascal's triangle A007318: T(n,k) = 2*C(n,k).
%C Also number of binary vectors of length n+1 with k+1 runs (1 <= k <= n).
%C If the last two entries in each row are removed and 0 replaces the entries in a checkerboard pattern, we obtain
%C 2;
%C 0, 6;
%C 2, 0, 12;
%C 0, 10, 0, 20;
%C 2, 0, 30, 0, 30;
%C 0, 14, 0, 70, 0, 42;
%C 2, 0, 56, 0, 140, 0, 56;
%C 0, 18, 0, 168, 0, 252, 0, 72;
%C ...
%C 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
%C From _Roger Ford_, Jul 06 2023: (Start)
%C 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).
%C Example of closed meanders with 4 top arches and 5 exterior arches:
%C exterior arches are top arches or bottom arches without a covering arch
%C /\ = top arch length 1, \/ = bottom arch length 1
%C __ __ __
%C / \ Top: /\=3 / \ / \ Top: /\=2
%C /\ / /\ \ /\ / /\ \ / /\ \
%C \ \/ / \ \/ / Bottom: \/=2 \/ \ \/ / \/ Bottom: /\=3
%C \__/ \__/ k=5-5=0 \__/ k=5-5=0 T(4,0) = 2
%C ______ __
%C / \ Top: /\=3 / \ Top: /\=3
%C /\ / /\ /\ \ / /\ \ /\ /\
%C \ \/ / \/ \/ Bottom: \/=3 \/ \ \/ \/ / Bottom: \/=3
%C \__/ k=6-5=1 \______/ k=6-5=1
%C ______ __
%C / \ Top: /\=3 / \ Top: /\=3
%C / /\ /\ \ /\ /\ /\ / /\ \
%C \/ \/ \ \/ / Bottom: \/=3 \ \/ \/ / \/ Bottom: \/=3
%C \__/ k=6-5=1 \______/ k=6-5=1 T(4,1) = 4
%C __________
%C / \ Top: /\=3
%C / /\ /\ /\ \ /\ /\ /\ /\ Top: /\=4
%C \/ \/ \/ \/ Bottom: \/=4 \ \/ \/ \/ / Bottom: ||=3
%C k=7-5=2 \__________/ k=7-5=2 T(4,2) = 2.
%C (End)
%D I. Goulden and D. Jackson, Combinatorial Enumeration, John Wiley and Sons, 1983, page 76.
%H Reinhard Zumkeller, <a href="/A028326/b028326.txt">Rows n=0..150 of triangle, flattened</a>
%H R. J. Mathar, <a href="http://arxiv.org/abs/1311.6135">Paving rectangular regions with rectangular tiles: tatami and non-tatami tilings</a>, arXiv:1311.6135 [math.CO], 2013, Table 48.
%H Franck Ramaharo, <a href="https://arxiv.org/abs/1802.07701">Statistics on some classes of knot shadows</a>, arXiv:1802.07701 [math.CO], 2018.
%H <a href="/index/Pas#Pascal">Index entries for triangles and arrays related to Pascal's triangle</a>
%F 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
%e Triangle begins:
%e 2;
%e 2, 2;
%e 2, 4, 2;
%e 2, 6, 6, 2;
%e 2, 8, 12, 8, 2;
%e 2, 10, 20, 20, 10, 2;
%e 2, 12, 30, 40, 30, 12, 2;
%e 2, 14, 42, 70, 70, 42, 14, 2;
%e 2, 16, 56, 112, 140, 112, 56, 16, 2;
%e 2, 18, 72, 168, 252, 252, 168, 72, 18, 2;
%e 2, 20, 90, 240, 420, 504, 420, 240, 90, 20, 2;
%e 2, 22, 110, 330, 660, 924, 924, 660, 330, 110, 22, 2;
%e 2, 24, 132, 440, 990, 1584, 1848, 1584, 990, 440, 132, 24, 2;
%p 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:
%p for n from 0 to 13 do seq(T(n, k), k=0..n) od; # _Zerinvary Lajos_, Dec 16 2006
%t Table[2*Binomial[n, k], {n, 0, 11}, {k, 0, n}]//Flatten (* _Robert G. Wilson v_, Mar 05 2012 *)
%o (Haskell)
%o a028326 n k = a028326_tabl !! n !! k
%o a028326_row n = a028326_tabl !! n
%o a028326_tabl = iterate
%o (\row -> zipWith (+) ([0] ++ row) (row ++ [0])) [2]
%o -- _Reinhard Zumkeller_, Mar 12 2012
%o (PARI) T(n,k) = 2*binomial(n,k) \\ _Charles R Greathouse IV_, Feb 07 2017
%o (Python)
%o from sympy import binomial
%o def T(n, k):
%o return 2*binomial(n, k)
%o for n in range(21): print([T(n, k) for k in range(n + 1)]) # _Indranil Ghosh_, Apr 29 2017
%o (Magma) [2*Binomial(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Apr 27 2021
%o (Sage) flatten([[2*binomial(n,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Apr 27 2021
%Y Cf. A007318, A028327, A028328, A028329, A028330, A028331, A028332, A124927, A134058.
%K nonn,tabl,easy,nice
%O 0,1
%A _Mohammad K. Azarian_
%E More terms from Donald Manchester, Jr. (s1199170(AT)cedarnet.cedarville.edu)