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

A135233 Triangle A007318 * A193554, read by rows.

Original entry on oeis.org

1, 2, 1, 5, 3, 1, 14, 7, 5, 1, 41, 15, 17, 7, 1, 122, 31, 49, 31, 9, 1, 365, 63, 129, 111, 49, 11, 1, 1094, 127, 321, 351, 209, 71, 13, 1, 3281, 255, 769, 1023, 769, 351, 97, 15, 1, 9842, 511, 1793, 2815, 2561, 1471, 545, 127, 17, 1
Offset: 0

Views

Author

Gary W. Adamson, Nov 23 2007

Keywords

Comments

Row sums = 3^n.
Left column = A007051: (1, 2, 5, 14, 41, 122, ...).

Examples

			First few rows of the triangle:
   1;
   2,  1;
   5,  3,  1;
  14,  7,  5,  1;
  41, 15, 17,  7,  1;
...
		

Crossrefs

Programs

  • Magma
    function T(n,k)
      if k eq n then return 1;
      elif k eq 0 then return (3^n+1)/2;
      else return (&+[(-1)^(n-k+j)*2^j*Binomial(n, j): j in [0..n-k]]);
      end if; return T; end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 20 2019
    
  • Maple
    T:= proc(n, k) option remember;
          if k=n then 1
        elif k=0 then (3^n_1)/2
        else add((-1)^(n-k+j)*binomial(n, j)*2^j, j=0..n-k)
          fi; end:
    seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Nov 20 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, (3^n+1)/2, Sum [(-1)^(n-k+i)* Binomial[n, i]*2^i, {i, 0, n-k}]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 20 2019 *)
  • PARI
    T(n,k) = if(k==n, 1, if(k==0, (3^n+1)/2, sum(j=0, n-k, (-1)^(n-k+j)*binomial(n,j)*2^j) )); \\ G. C. Greubel, Nov 20 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==n): return 1
        elif (k==0): return (3^n+1)/2
        else: return sum((-1)^(n-k+j)*2^j*binomial(n, j) for j in (0..n-k))
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 20 2019

Formula

Binomial transform of A193554, as infinite lower triangular matrices.
T(n,k) = Sum_{j=0..n-k} (-1)^(n-k+j)*binomial(n,j)*2^j, with T(n,n) = 1, and T(n,0) = (3^n + 1)/2. - G. C. Greubel, Nov 20 2019

Extensions

Definition corrected by N. J. A. Sloane, Jul 30 2011

A193787 Triangular array: the fusion of polynomial sequences P and Q given by p(n,x)=(x+1)^n and q(n,x)=1+x^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 4, 1, 3, 3, 1, 8, 1, 4, 6, 4, 1, 16, 1, 5, 10, 10, 5, 1, 32, 1, 6, 15, 20, 15, 6, 1, 64, 1, 7, 21, 35, 35, 21, 7, 1, 128, 1, 8, 28, 56, 70, 56, 28, 8, 1, 256, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 512, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1
Offset: 0

Views

Author

Clark Kimberling, Aug 05 2011

Keywords

Comments

See A193722 for the definition of fusion of two sequences of polynomials or triangular arrays. A193787 is the mirror (obtained by reversing rows) of A193554.

Examples

			First six rows:
1
1....1
1....1....2
1....2....1....4
1....3....3....1...8
1....4....6....4...1...16
(viz., Pascal's triangle with row sum at end of each row)
		

Crossrefs

Programs

  • Mathematica
    z = 12; a = 1; b = 1;
    p[n_, x_] := (a*x + b)^n
    q[n_, x_] := 1 + x^n ; q[n_, 0] := q[n, x] /. x -> 0;
    t[n_, k_] := Coefficient[p[n, x], x^k]; t[n_, 0] := p[n, x] /. x -> 0;
    w[n_, x_] := Sum[t[n, k]*q[n + 1 - k, x], {k, 0, n}]; w[-1, x_] := 1
    g[n_] := CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n, -1, z}]]  (* A193787 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]]  (* A193554 *)
Showing 1-2 of 2 results.