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-4 of 4 results.

A034870 Even-numbered rows of Pascal's triangle.

Original entry on oeis.org

1, 1, 2, 1, 1, 4, 6, 4, 1, 1, 6, 15, 20, 15, 6, 1, 1, 8, 28, 56, 70, 56, 28, 8, 1, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 1, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1, 1, 14, 91, 364, 1001, 2002, 3003, 3432, 3003, 2002, 1001, 364, 91, 14, 1
Offset: 0

Views

Author

Keywords

Comments

The sequence of row lengths of this array is [1,3,5,7,9,11,13,...]= A005408(n), n>=0.
Equals X^n * [1,0,0,0,...] where X = an infinite tridiagonal matrix with (1,1,1,...) in the main and subsubdiagonal and (2,2,2,...) in the main diagonal. X also = a triangular matrix with (1,2,1,0,0,0,...) in each column. - Gary W. Adamson, May 26 2008
a(n,m) has the following interesting combinatoric interpretation. Let s(n,m) equal the set of all base-4, n-digit numbers with n-m more 1-digits than 2-digits. For example s(2,1) = {10,01,13,31} (note that numbers like 1 are left-padded with 0's to ensure that they have 2 digits). Notice that #s(2,1) = a(2,1) with # indicating cardinality. This is true in general. a(n,m)=#s(n,m). In words, a(n,m) gives the number of n-digit, base-4 numbers with n-m more 1 digits than 2 digits. A proof is provided in the Links section. - Russell Jay Hendel, Jun 23 2015

Examples

			Triangle begins:
  1;
  1,  2,  1;
  1,  4,  6,   4,   1;
  1,  6, 15,  20,  15,   6,   1;
  1,  8, 28,  56,  70,  56,  28,   8,   1;
  1, 10, 45, 120, 210, 252, 210, 120,  45,  10,  1;
  1, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1;
		

Crossrefs

Cf. A000302 (row sums, powers of 4), alternating row sums are 0, except for n=0 which gives 1.

Programs

  • Haskell
    a034870 n k = a034870_tabf !! n !! k
    a034870_row n = a034870_tabf !! n
    a034870_tabf = map a007318_row [0, 2 ..]
    -- Reinhard Zumkeller, Apr 19 2012, Apr 02 2011
    
  • Magma
    /* As triangle: */ [[Binomial(n,k): k in [0..n]]: n in [0.. 15 by 2]]; // Vincenzo Librandi, Jul 16 2015
    
  • Maple
    T := (n,k) -> simplify(GegenbauerC(`if`(kPeter Luschny, May 08 2016
  • Mathematica
    Flatten[Table[Binomial[n,k],{n,0,20,2},{k,0,n}]] (* Harvey P. Dale, Dec 15 2014 *)
  • Maxima
    taylor(1/(1-x*(y+1)^2),x,0,10,y,0,10); /* Vladimir Kruchinin, Nov 22 2020 */
    
  • Sage
    flatten([[binomial(2*n, k) for k in (0..2*n)] for n in (0..12)]) # G. C. Greubel, Mar 18 2022

Formula

T(n, m) = binomial(2*n, m), 0<= m <= 2*n, 0<=n, else 0.
G.f. for column m=2*k sequence: (x^k)*Pe(k, x)/(1-x)^(2*k+1), k>=0; for column m=2*k-1 sequence (x^k)*Po(k, x)/(1-x)^(2*k), k>=1, with the row polynomials Pe(k, x) := sum(A091042(k, m)*x^m, m=0..k) and Po(k, x) := 2*sum(A091044(k, m)*x^m, m=0..k-1); see also triangle A091043.
From Paul D. Hanna, Apr 18 2012: (Start)
Let A(x) be the g.f. of the flattened sequence, then:
G.f.: A(x) = Sum_{n>=0} x^(n^2) * (1+x)^(2*n).
G.f.: A(x) = Sum_{n>=0} x^n*(1+x)^(2*n) * Product_{k=1..n} (1 - (1+x)^2*x^(4*k-3)) / (1 - (1+x)^2*x^(4*k-1)).
G.f.: A(x) = 1/(1 - x*(1+x)^2/(1 + x*(1-x^2)*(1+x)^2/(1 - x^5*(1+x)^2/(1 + x^3*(1-x^4)*(1+x)^2/(1 - x^9*(1+x)^2/(1 + x^5*(1-x^6)*(1+x)^2/(1 - x^13*(1+x)^2/(1 + x^7*(1-x^8)*(1+x)^2/(1 - ...))))))))), a continued fraction.
(End)
From Peter Bala, Jul 14 2015: (Start)
Denote this array by P. Then P * transpose(P) is the square array ( binomial(2*n + 2*k, 2*k) )n,k>=0, which, read by antidiagonals, is A086645.
Transpose(P) is a generalized Riordan array (1, (1 + x)^2) as defined in the Bala link.
Let p(x) = (1 + x)^2. P^2 gives the coefficients in the expansion of the polynomials ( p(p(x)) )^n, P^3 gives the coefficients in the expansion of the polynomials ( p(p(p(x))) )^n and so on.
Row sums are 2^(2*n); row sums of P^2 are 5^(2*n), row sums of P^3 are 26^(2*n). In general, the row sums of P^k, k = 0,1,2,..., are equal to A003095(k)^(2*n).
The signed version of this array ( (-1)^k*binomial(2*n,k) )n,k>=0 is a left-inverse for A034839.
A034839 * P = A080928. (End)
T(n, k) = GegenbauerC(m, -n, -1) where m = k if kPeter Luschny, May 08 2016
G.f.: 1/(1-x*(y+1)^2). - Vladimir Kruchinin, Nov 22 2020

A111910 Square array read by antidiagonals: S(p,q) = (p+q+1)!(2p+2q+1)!/((p+1)!(2p+1)!(q+1)!(2q+1)!) (p,q>=0).

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 14, 14, 1, 1, 30, 84, 30, 1, 1, 55, 330, 330, 55, 1, 1, 91, 1001, 2145, 1001, 91, 1, 1, 140, 2548, 10010, 10010, 2548, 140, 1, 1, 204, 5712, 37128, 68068, 37128, 5712, 204, 1, 1, 285, 11628, 116280, 352716, 352716, 116280, 11628, 285, 1
Offset: 0

Views

Author

Emeric Deutsch, Aug 19 2005

Keywords

Examples

			Array S(n,k) in rectangular form (n, k >= 0):
  1,  1,    1,     1,    1,       1,       1,       1,        1, ...
  1,  5,   14,    30,   55,      91,     140,     204,      285, ...
  1, 14,   84,   330,  1001,   2548,    5712,   11628,    21945, ...
  1, 30,  330,  2145, 10010,  37128,  116280,  319770,   793155, ...
  1, 55, 1001, 10010, 68068, 352716, 1492260, 5393454, 17185025, ...
  ...
Array T(n,k) in triangular form (n >= 0 and 0 <= k <= n):
  1,
  1,  1,
  1,  5,    1,
  1, 14,   14,   1,
  1, 30,   84,  30,     1,
  1, 55,  330, 330,    55,  1,
  1, 91, 1001, 2145, 1001, 91, 1,
  ...
		

Crossrefs

Cf. A091044, A111911 (main diagonal), A196148 (row sums of triangle).

Programs

  • Magma
    T:= func< n,k | Binomial(n+1, k)*Binomial(2*n+1, 2*k)/((k+1)*(2*k+1)) >;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Feb 12 2021
  • Maple
    a:=(p,q)->(p+q+1)!*(2*p+2*q+1)!/(p+1)!/(2*p+1)!/(q+1)!/(2*q+1)!: for n from 0 to 10 do seq(a(j,n-j),j=0..n) od; # yields sequence in triangular form
  • Mathematica
    Table[(# + q + 1)! (2 # + 2 q + 1)!/((# + 1)! (2 # + 1)! (q + 1)! (2 q + 1)!) &[r - q], {r, 0, 9}, {q, 0, r}] // Flatten (* Michael De Vlieger, Oct 21 2019 *)
    Table[Binomial[n+1, k]*Binomial[2*n+1, 2*k]/((k+1)*(2*k+1)), {n, 0, 12}, {k, 0,
    n}]//Flatten (* G. C. Greubel, Feb 12 2021 *)
  • Sage
    def A111910(n,k): return binomial(n+1, k)*binomial(2*n+1, 2*k)/((k+1)*(2*k+1))
    flatten([[A111910(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 12 2021
    

Formula

S(n,n) = A111911(n).
From Peter Bala, Oct 13 2011: (Start)
Define a(n) = n!*(n+1/2)!*(n+1)!/(1/2)!.
S(n,k) = a(n+k)/(a(n)*a(k)) gives the sequence as a square array while T(n,k) = a(n)/(a(n-k)*a(k)) gives the sequence as a triangle.
S(n-1,k)*S(n,k+1)*S(n+1,k-1) = S(n-1,k+1)*S(n,k-1)*S(n+1,k). Cf. A091044.
(End)
From G. C. Greubel, Feb 12 2021: (Start)
As a number triangle:
T(n, k) = binomial(n+1, k)*binomial(2*n+1, 2*k)/((k+1)*(2*k+1)).
T(n, k) = binomial(2*n+1, 2*k)/((2*k+1)*binomial(n, k)) * A001263(n+1, k+1). (End)
From Peter Bala, Sep 19 2021: (Start)
As a triangle: T(n,k) = a(n)/(a(n-k)*a(k)), where a(n) = Product_{j = 1..n} s(p,j) with s(p,j) = Sum_{j = 1..n} j^p and p = 2. Note, p = 0 gives Pascal's triangle A007318, p = 1 gives the triangle of Narayana numbers A001263 and p = 3 gives the triangle A174158 whose entries are the squares of the Narayana numbers.
Let E(y) = Sum_{n >= 0} y^n/((n+1)!*(2*n+1)!). Then as a triangle this is the generalized Riordan array (E(y), y) as defined in Wang and Wang with respect to the sequence c_n = (n+1)!*(2*n+1)!. Cf. A001263.
Generating function: E(y)*E(x*y) = 1 + (1 + x)*y/(2!*3!) + (1 + 5*x + x^2)*y^2/(3!*5!) + (1 + 14*x + 14*x^2 + x^3)*y^3/(4!*7!) + ....
The n-th power of this array has a generating function E(y)^n*E(x*y). In particular, the matrix inverse has a generating function E(x*y)/E(y).
exp(y)*E(y) = 1 + 13*y/(2!*3!) + 421*y^2/(3!*5!) + 25368*y^3/(4!*7!) + ... is essentially a generating function for A081442. (End)

Extensions

Example section edited by Petros Hadjicostas, Sep 03 2019

A381706 Three-dimensional array of the number b(n, k, i) of permutations of k chosen numbers in {1,2,...,n} with i-1 descents, n >= 1, 1 <= k <= n, 1 <= i <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 4, 1, 1, 1, 1, 1, 1, 5, 5, 1, 1, 11, 11, 1, 1, 11, 11, 1, 1, 1, 1, 1, 1, 1, 6, 6, 6, 1, 1, 16, 26, 16, 1, 1, 26, 66, 26, 1, 1, 26, 66, 26, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 1, 1, 22, 37, 37, 22, 1, 1, 42, 137, 137, 42, 1
Offset: 1

Views

Author

Timothy Y. Chow, Mar 04 2025

Keywords

Comments

For n >= 1, 0 <= k <= n-2, and 0 <= i <= n-1, b(n+1, k+1, i+1) is the (2i)th Betti number of the prepermutohedral variety X_k obtained by k iterated blowups of projective space P^n.

Examples

			For n = 4 and k = 2, there are 12 permutations of 2 chosen numbers in {1,2,3,4}; the number of descents is defined to be the number of descents in the permutation of the chosen numbers, plus the number of non-chosen numbers greater than the first chosen number. For example, 32 has 2 descents because 3 is greater than 2 and 4 (a non-chosen number) is greater than 3. The four other permutations of 2 chosen numbers with 2 descents are 31, 12, 13, 14.
The sequence is most naturally viewed as a sequence of squares of size 1x1, 2x2, 3x3, 4x4, etc.
  1               [E(1)]
  1  1
  1  1            [E(2)]
  1  1  1
  1  4  1
  1  4  1         [E(3)]
  1  1  1  1
  1  5  5  1
  1 11 11  1
  1 11 11  1      [E(4)]
  1  1  1  1  1
  1  6  6  6  1
  1 16 26 16  1
  1 26 66 26  1
  1 26 66 26  1   [E(5)]
  ...
[E(n)] refers to row n of A008292.
		

Crossrefs

Programs

  • Maple
    beta := proc(n, k)
       local b, p, plist, descents, s, i, r, R:
       r := 1..n; R := {`$`(r)};
       b := Array(r, fill=0);
       plist := combinat:-permute(n, k):
       for p in plist do
          descents := 1:
          s := R minus {op(p)}:
          for i in s do
             if i > p[1] then descents := descents + 1 end if:
          end do:
          for i to k-1 do
             if p[i] > p[i+1] then descents := descents + 1 end if:
          end do:
          b[descents] := b[descents] + 1:
       end do:
       return b
    end proc:
    for n from 1 to 5 do seq(beta(n, k), k = 1..n) end do;
    # After Max Alekseyev's PARI program:
    b := (n, k, i) -> local p, t, j; add(add(binomial(n - p, t) * binomial(p - 1, n - k - t) * add(binomial(k, j)*(-1)^j*(i - t - j)^(n - t - p) * (i - 1 - t - j)^(k - n - 1 + t + p), j = 0..i-1-t), t = n+1-k-p..i-1), p = 1..n): seq(seq(seq(b(n, k, j), j = 1..n), k = 1..n), n = 1..6);  # Peter Luschny, Mar 15 2025
  • PARI
    { b(n,k,i) = sum(p=1, n, sum(t=n+1-k-p,i-1, my(l=n+1-t-p); binomial(n-p,t) * binomial(p-1,n-k-t) * sum(j=0,i-1-t, binomial(k,j) * (-1)^j * (i-t-j)^(l-1) * (i-1-t-j)^(k-l) )) ); } \\ Max Alekseyev, Mar 14 2025
  • SageMath
    def beta(n: int, k: int) -> list[int]:
        b = [0]*n
        for p in Permutations(n, k):
            descents = sum(int(not i in p and i > p[0]) for i in (1..n))
            descents += sum(int(p[i-1] > p[i]) for i in (1..k-1))
            b[descents] += 1
        return b
    def Trow(n) -> list[int]: return flatten([beta(n, k) for k in (1..n)])
    for n in (1..6): print(f"{n}: ", Trow(n))  # Peter Luschny, Mar 11 2025
    

Formula

Explicit formula for b(n, k, i) is given in MO link and PARI code below. - Max Alekseyev, Mar 14 2025
The recurrence b(n,k,i) = b(n,k-1,i) + (n choose k) Sum_{i=d-n+k}^{d-1} b(k-1,k-2,j) was conjectured by Ron Fertig and proved by Alex R. Miller.
b(n, n, k) equals the Eulerian number T(n, k) of A008292.
If n > 1 then b(n, n-1, k) also equals the Eulerian number T(n, k) of A008292.
Sum_{i} b(n, k, i) equals the falling factorial A068424.
Empirically, Sum_{k} b(n, k, i) seems to equal A381888.

A324010 The sum of squares of the number of common points in all pairs of lattice paths from (0,0) to (x,y), for x >= 0, y >= 0 (the unnormalized second moment). The table is read by antidiagonals.

Original entry on oeis.org

1, 4, 4, 9, 26, 9, 16, 92, 92, 16, 25, 240, 474, 240, 25, 36, 520, 1704, 1704, 520, 36, 49, 994, 4879, 8084, 4879, 994, 49, 64, 1736, 11928, 29560, 29560, 11928, 1736, 64, 81, 2832, 25956, 89928, 134450, 89928, 25956, 2832, 81, 100, 4380, 51648, 238440, 498140, 498140, 238440, 51648, 4380, 100
Offset: 0

Views

Author

Günter Rote, Feb 12 2019

Keywords

Examples

			There are two lattice paths from (0,0) to (x,y)=(1,1): P1=(0,0),(1,0),(1,1) and P2=(0,0),(0,1),(1,1), and hence 4 pairs of lattice paths: (P1,P1),(P1,P2),(P2,P1),(P2,P2). The number of common points is 3,2,2,3, respectively, and the sum of the squares of these numbers is 9+4+4+9 = 26 = a(1,1).
Table begins
   1   4    9    16     25 ...
   4  26   92   240    520 ...
   9  92  474  1704   4879 ...
  16 240 1704  8084  29560 ...
  25 520 4879 29560 134450 ...
  ...
		

Crossrefs

See A306687 for the lower triangular half of the same data, read by rows.
See A091044 for the unnormalized first moment (the sum of the number of common points without squaring).

Programs

  • Mathematica
    Table[(# + y + 1) Binomial[# + y + 2, # + 1] Binomial[# + y, #] - Binomial[2 # + 2 y + 2, 2 # + 1]/2 &[x - y], {x, 0, 9}, {y, 0, x}] // Flatten (* Michael De Vlieger, Apr 15 2019 *)
  • PARI
    a(x,y) = (x+y+1)*binomial(x+y+2,x+1)*binomial(x+y,x)-binomial(2*x+2*y+2,2*x+1)/2;
    matrix(10, 10, n, k, a(n-1,k-1)) \\ Michel Marcus, Apr 08 2019

Formula

A(x,y) = (x+y+1) * binomial(x+y+2,x+1) * binomial(x+y,x) - binomial(2*x+2*y+2,2*x+1)/2.
Showing 1-4 of 4 results.