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

A104967 Matrix inverse of triangle A104219, read by rows, where A104219(n,k) equals the number of Schroeder paths of length 2n having k peaks at height 1.

Original entry on oeis.org

1, -1, 1, -1, -2, 1, -1, -1, -3, 1, -1, 0, 0, -4, 1, -1, 1, 2, 2, -5, 1, -1, 2, 3, 4, 5, -6, 1, -1, 3, 3, 3, 5, 9, -7, 1, -1, 4, 2, 0, 0, 4, 14, -8, 1, -1, 5, 0, -4, -6, -6, 0, 20, -9, 1, -1, 6, -3, -8, -10, -12, -14, -8, 27, -10, 1, -1, 7, -7, -11, -10, -10, -14, -22, -21, 35, -11, 1, -1, 8, -12, -12, -5, 0, 0, -8, -27, -40, 44, -12, 1
Offset: 0

Views

Author

Paul D. Hanna, Mar 30 2005

Keywords

Comments

Row sums equal A090132 with odd-indexed terms negated. Absolute row sums form A104968. Row sums of squared terms gives A104969.
Riordan array ((1-2*x)/(1-x), x(1-2*x)/(1-x)). - Philippe Deléham, Dec 05 2015

Examples

			Triangle begins:
   1;
  -1,  1;
  -1, -2,  1;
  -1, -1, -3,  1;
  -1,  0,  0, -4,  1;
  -1,  1,  2,  2, -5,  1;
  -1,  2,  3,  4,  5, -6,  1;
  -1,  3,  3,  3,  5,  9, -7,  1;
  -1,  4,  2,  0,  0,  4, 14, -8,  1;
  -1,  5,  0, -4, -6, -6,  0, 20, -9, 1; ...
		

Crossrefs

Cf. A347171 (rows reversed, up to signs).

Programs

  • Magma
    A104967:= func< n,k | (&+[(-2)^j*Binomial(k+1, j)*Binomial(n-j, k): j in [0..n-k]]) >;
    [A104967(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 09 2021
  • Maple
    A104967:= (n,k)-> add( (-2)^j*binomial(k+1, j)*binomial(n-j, k), j=0..n-k);
    seq(seq( A104967(n,k), k=0..n), n=0..12); # G. C. Greubel, Jun 09 2021
  • Mathematica
    T[n_, k_]:= T[n, k]= Which[k==n, 1, k==0, 0, True, T[n-1, k-1] - Sum[T[n-i, k-1], {i, 2, n-k+1}]];
    Table[T[n, k], {n, 13}, {k, n}]//Flatten (* Jean-François Alcover, Jun 11 2019, after Peter Luschny *)
  • Maxima
    T(n,k):=sum((-2)^i*binomial(k+1,i)*binomial(n-i,k),i,0,n-k); /* Vladimir Kruchinin, Nov 02 2011 */
    
  • PARI
    {T(n,k)=local(X=x+x*O(x^n),Y=y+y*O(y^k)); polcoeff(polcoeff((1-2*X)/(1-X-X*Y*(1-2*X)),n,x),k,y)}
    for(n=0, 16, for(k=0, n, print1(T(n, k), ", ")); print(""))
    
  • Sage
    def A104967_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return prec(n-1,k-1)-sum(prec(n-i,k-1) for i in (2..n-k+1))
        return [prec(n, k) for k in (1..n)]
    for n in (1..10): print(A104967_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

G.f.: A(x, y) = (1-2*x)/(1-x - x*y*(1-2*x)).
Sum_{k=0..n} T(n, k) = (-1)^n*A090132(n).
Sum_{k=0..n} abs(T(n, k)) = A104968(n).
Sum_{k=0..n} T(n, k)^2 = A104969(n).
T(n,k) = Sum_{i=0..n-k} (-2)^i*binomial(k+1,i)*binomial(n-i,k). - Vladimir Kruchinin, Nov 02 2011
Sum_{k=0..floor(n/2)} T(n-k, k) = A078011(n+2). - G. C. Greubel, Jun 09 2021

A104969 Sum of squares of terms in rows of triangle A104967.

Original entry on oeis.org

1, 2, 6, 12, 18, 36, 92, 184, 298, 596, 1444, 2888, 4852, 9704, 22840, 45680, 78490, 156980, 362580, 725160, 1265564, 2531128, 5767688, 11535376, 20366596, 40733192, 91866984, 183733968, 327351336, 654702672, 1464522864, 2929045728
Offset: 0

Views

Author

Paul D. Hanna, Mar 30 2005

Keywords

Crossrefs

Programs

  • Mathematica
    A104967[n_, k_]:= A104967[n, k]= Sum[(-2)^j*Binomial[k+1, j]*Binomial[n-j, k], {j, 0, n-k}];
    A104969[n_]:= A104969[n]= Sum[A104967[n, k]^2, {k,0,n}];
    Table[A104969[n], {n, 0, 50}] (* G. C. Greubel, Jun 09 2021 *)
  • PARI
    {a(n)=local(X=x+x*O(x^n)); sum(k=0,n,polcoeff(polcoeff((1-2*X)/(1-X-X*y*(1-2*X)),n,x),k,y)^2)}
    
  • Sage
    @cached_function
    def A104967(n,k): return sum( (-2)^j*binomial(k+1,j)*binomial(n-j,k) for j in (0..n-k))
    def A104969(n): return sum((A104967(n,k))^2 for k in (0..n))
    [A104969(n) for n in (0..50)] # G. C. Greubel, Jun 09 2021

Formula

a(2*n+1) = 2*a(2*n).
G.f.: A(x) = (1+2*x)*G(x^2) where G(x) is the g.f. of A104970 such that G(x) satisfies: 2*(1+12*x)*G(x) - (1-16*x^2)*deriv(G(x), x) + 4 = 0.
a(n) = Sum_{k=0..n} (A104967(n, k))^2.

A104970 Sum of squares of terms in even-indexed rows of triangle A104967.

Original entry on oeis.org

1, 6, 18, 92, 298, 1444, 4852, 22840, 78490, 362580, 1265564, 5767688, 20366596, 91866984, 327351336, 1464522864, 5257011066, 23361650484, 84371466636, 372831130344, 1353477992556, 5952169844664, 21704580414936, 95051752387344
Offset: 0

Views

Author

Paul D. Hanna, Mar 30 2005

Keywords

Comments

Sum of squares of terms in odd-indexed rows of triangle A104967 equals twice this sequence.

Crossrefs

Programs

  • Magma
    A104970:= func< n | n eq 0 select 1 else  4^n + (&+[(-1)^j*2^(2*n-2*j-1)*Binomial(2*j+1,j+1): j in [0..n-1]]) >;
    [A104970(n): n in [0..40]]; // G. C. Greubel, Jun 09 2021
    
  • Mathematica
    Flatten[{1,Table[2^(2*n-1)*(2+Sum[(-1)^k*Binomial[2*k+1,k+1]/2^(2*k),{k,0,n-1}]),{n,1,20}]}] (* Vaclav Kotesovec, Oct 28 2012 *)
  • PARI
    {a(n)=local(X=x+x*O(x^(2*n))); sum(k=0,2*n,polcoeff(polcoeff((1-2*X)/(1-X-X*y*(1-2*X)),2*n,x),k,y)^2)}
    
  • Sage
    @cached_function
    def A104967(n,k): return sum( (-2)^j*binomial(k+1,j)*binomial(n-j,k) for j in (0..n-k))
    def A104970(n): return sum((A104967(2*n,k))^2 for k in (0..2*n))
    [A104970(n) for n in (0..50)] # G. C. Greubel, Jun 09 2021

Formula

G.f. A(x) satisfies: 2*(1+12*x)*A(x) - (1-16*x^2)*deriv(A(x), x) + 4 = 0.
a(n) = 2^(2*n-1)*(2 + Sum_{k=0..n-1} (-1)^k*binomial(2*k+1,k+1)/2^(2*k)). - Vaclav Kotesovec, Oct 28 2012
Showing 1-3 of 3 results.