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

A227791 Central terms of the triangle in A227550.

Original entry on oeis.org

1, 2, 8, 36, 176, 940, 5568, 37128, 280992, 2410812, 23250080, 249164344, 2934303264, 37617633976, 521009920256, 7748175156240, 123095897716800, 2080205257723740, 37253560076385120, 704703668205036120, 14039778681732928800, 293831851498842784680
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 05 2013

Keywords

Crossrefs

Programs

  • Haskell
    a227791 n = a227550 (2 * n) n
  • Maple
    b:= proc(x, y) option remember; `if`(x=0, y!,
          b(x-1, y)+b(sort([x, y-1])[]))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..26);  # Alois P. Heinz, Jul 14 2021
  • Mathematica
    T[n_, 0] := n!; T[n_, n_] := n!;
    T[n_, k_] /; 0Jean-François Alcover, Nov 03 2022 *)

Formula

a(n) = A074911(2*n,n).

A228196 A triangle formed like Pascal's triangle, but with n^2 on the left border and 2^n on the right border instead of 1.

Original entry on oeis.org

0, 1, 2, 4, 3, 4, 9, 7, 7, 8, 16, 16, 14, 15, 16, 25, 32, 30, 29, 31, 32, 36, 57, 62, 59, 60, 63, 64, 49, 93, 119, 121, 119, 123, 127, 128, 64, 142, 212, 240, 240, 242, 250, 255, 256, 81, 206, 354, 452, 480, 482, 492, 505, 511, 512, 100, 287, 560, 806, 932, 962, 974, 997, 1016, 1023, 1024
Offset: 1

Views

Author

Boris Putievskiy, Aug 15 2013

Keywords

Comments

The third row is (n^4 - n^2 + 24*n + 24)/12.
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 04 2013

Examples

			The start of the sequence as a triangular array read by rows:
   0;
   1,  2;
   4,  3,  4;
   9,  7,  7,  8;
  16, 16, 14, 15, 16;
  25, 32, 30, 29, 31, 32;
  36, 57, 62, 59, 60, 63, 64;
		

Crossrefs

Cf. We denote Pascal-like triangle with L(n) on the left border and R(n) on the right border by (L(n),R(n)). A007318 (1,1), A008949 (1,2^n), A029600 (2,3), A029618 (3,2), A029635 (1,2), A029653 (2,1), A037027 (Fibonacci(n),1), A051601 (n,n) n>=0, A051597 (n,n) n>0, A051666 (n^2,n^2), A071919 (1,0), A074829 (Fibonacci(n), Fibonacci(n)), A074909 (1,n), A093560 (3,1), A093561 (4,1), A093562 (5,1), A093563 (6,1), A093564 (7,1), A093565 (8,1), A093644 (9,1), A093645 (10,1), A095660 (1,3), A095666 (1,4), A096940 (1,5), A096956 (1,6), A106516 (3^n,1), A108561(1,(-1)^n), A132200 (4,4), A134636 (2n+1,2n+1), A137688 (2^n,2^n), A160760 (3^(n-1),1), A164844(1,10^n), A164847 (100^n,1), A164855 (101*100^n,1), A164866 (101^n,1), A172171 (1,9), A172185 (9,11), A172283 (-9,11), A177954 (int(n/2),1), A193820 (1,2^n), A214292 (n,-n), A227074 (4^n,4^n), A227075 (3^n,3^n), A227076 (5^n,5^n), A227550 (n!,n!), A228053 ((-1)^n,(-1)^n), A228074 (Fibonacci(n), n).
Cf. A000290 (row 1), A153056 (row 2), A000079 (column 1), A000225 (column 2), A132753 (column 3), A118885 (row sums of triangle array + 1), A228576 (generalized Pascal's triangle).

Programs

  • GAP
    T:= function(n,k)
        if k=0 then return n^2;
        elif k=n then return 2^n;
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Nov 12 2019
  • Maple
    T:= proc(n, k) option remember;
          if k=0 then n^2
        elif k=n then 2^k
        else T(n-1, k-1) + T(n-1, k)
          fi
        end:
    seq(seq(T(n, k), k=0..n), n=0..10); # G. C. Greubel, Nov 12 2019
  • Mathematica
    T[n_, k_]:= T[n, k] = If[k==0, n^2, If[k==n, 2^k, T[n-1, k-1] + T[n-1, k]]]; Table[T[n, k], {n,0,10}, {k,0,n}]//Flatten (* G. C. Greubel, Nov 12 2019 *)
    Flatten[Table[Sum[i^2 Binomial[n-1-i, n-k-i], {i,1,n-k}] + Sum[2^i Binomial[n-1-i, k-i], {i,1,k}], {n,0,10}, {k,0,n}]] (* Greg Dresden, Aug 06 2022 *)
  • PARI
    T(n,k) = if(k==0, n^2, if(k==n, 2^k, T(n-1, k-1) + T(n-1, k) )); \\ G. C. Greubel, Nov 12 2019
    
  • Python
    def funcL(n):
       q = n**2
       return q
    def funcR(n):
       q = 2**n
       return q
    for n in range (1,9871):
       t=int((math.sqrt(8*n-7) - 1)/ 2)
       i=n-t*(t+1)/2-1
       j=(t*t+3*t+4)/2-n-1
       sum1=0
       sum2=0
       for m1 in range (1,i+1):
          sum1=sum1+funcR(m1)*binomial(i+j-m1-1,i-m1)
       for m2 in range (1,j+1):
          sum2=sum2+funcL(m2)*binomial(i+j-m2-1,j-m2)
       sum=sum1+sum2
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0): return n^2
        elif (k==n): return 2^n
        else: return T(n-1, k-1) + T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 12 2019
    

Formula

T(n,0) = n^2, n>0; T(0,k) = 2^k; T(n, k) = T(n-1, k-1) + T(n-1, k) for n,k > 0. [corrected by G. C. Greubel, Nov 12 2019]
Closed-form formula for general case. Let L(m) and R(m) be the left border and the right border of Pascal like triangle, respectively. We denote binomial(n,k) by C(n,k).
As table read by antidiagonals T(n,k) = Sum_{m1=1..n} R(m1)*C(n+k-m1-1, n-m1) + Sum_{m2=1..k} L(m2)*C(n+k-m2-1, k-m2); n,k >=0.
As linear sequence a(n) = Sum_{m1=1..i} R(m1)*C(i+j-m1-1, i-m1) + Sum_{m2=1..j} L(m2)*C(i+j-m2-1, j-m2), where i=n-t*(t+1)/2-1, j=(t*t+3*t+4)/2-n-1, t=floor((-1+sqrt(8*n-7))/2); n>0.
Some special cases. If L(m)={b,b,b...} b*A000012, then the second sum takes form b*C(n+k-1,j). If L(m) is {0,b,2b,...} b*A001477, then the second sum takes form b*C(n+k,n-1). Similarly for R(m) and the first sum.
For this sequence L(m)=m^2 and R(m)=2^m.
As table read by antidiagonals T(n,k) = Sum_{m1=1..n} (2^m1)*C(n+k-m1-1, n-m1) + Sum_{m2=1..k} (m2^2)*C(n+k-m2-1, k-m2); n,k >=0.
As linear sequence a(n) = Sum_{m1=1..i} (2^m1)*C(i+j-m1-1, i-m1) + Sum_{m2=1..j} (m2^2)*C(i+j-m2-1, j-m2), where i=n-t*(t+1)/2-1, j=(t*t+3*t+4)/2-n-1, t=floor((-1+sqrt(8*n-7))/2).
As a triangular array read by rows, T(n,k) = Sum_{i=1..n-k} i^2*C(n-1-i, n-k-i) + Sum_{i=1..k} 2^i*C(n-1-i, k-i); n,k >=0. - Greg Dresden, Aug 06 2022

Extensions

Cross-references corrected and extended by Philippe Deléham, Dec 27 2013

A074911 Triangle generated by Pascal's rule, except begin and end the n-th row with n!.

Original entry on oeis.org

1, 2, 2, 6, 4, 6, 24, 10, 10, 24, 120, 34, 20, 34, 120, 720, 154, 54, 54, 154, 720, 5040, 874, 208, 108, 208, 874, 5040, 40320, 5914, 1082, 316, 316, 1082, 5914, 40320, 362880, 46234, 6996, 1398, 632, 1398, 6996, 46234, 362880
Offset: 1

Views

Author

Joseph L. Pe, Oct 01 2002

Keywords

Examples

			Triangle begins:
1;
2, 2;
6, 4, 6;
24, 10, 10, 24;
120, 34, 20, 34, 120;
720, 154, 54, 54, 154, 720;
5040, 874, 208, 108, 208, 874, 5040;
		

Crossrefs

Cf. A227550, A225621 (central terms).

Programs

  • Haskell
    a074911 n k = a074911_tabl !! (n-1) !! (k-1)
    a074911_row n = a074911_tabl !! (n-1)
    a074911_tabl = map fst $ iterate
       (\(vs, w:ws) -> (zipWith (+) ([w] ++ vs) (vs ++ [w]), ws))
       ([1], tail a001563_list)
    -- Reinhard Zumkeller, Aug 05 2013
  • Mathematica
    T[n_, 1] := n!;
    T[n_, n_] := n!;
    T[n_, k_] /; 1Jean-François Alcover, Nov 03 2022 *)
  • PARI
    t(n, k) = {if (k<1 || k>n, return (0)); if (k==1 || k==n, return (n!)); return (t(n-1, k-1) + t(n-1, k));}
    tabl(nn) = {for (n=1, nn, for (k=1, n, print1(t(n, k), ", ");); print(););} \\ Michel Marcus, May 19 2013
    

Extensions

More terms from Michel Marcus, May 19 2013

A140710 Number of maximal initial consecutive columns ending at the same level, summed over all deco polyominoes of height n.

Original entry on oeis.org

1, 3, 10, 38, 172, 944, 6208, 47696, 417952, 4101824, 44491648, 528068096, 6804155392, 94559581184, 1409615239168, 22434345998336, 379633330204672, 6805952938041344, 128854632579186688, 2568966172926181376
Offset: 1

Views

Author

Emeric Deutsch, Jun 03 2008

Keywords

Comments

A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column.

Examples

			a(3)=10 because the 6 deco polyominoes of height 3 have columns ending at levels 3, 22, 12, 111, 22, 122, respectively and 1+2+1+3+2+1=10.
		

Crossrefs

Row sums of A227550/2.

Programs

  • Magma
    [2^(n-1)*(&+[j*Factorial(j)/2^j: j in [1..n-1]]): n in [1..30]]; // G. C. Greubel, May 02 2021
    
  • Maple
    a:=proc(n) options operator, arrow: 2^(n-1)*(1+sum(j^2*factorial(j-1)/2^j, j= 1..n-1)) end proc: seq(a(n),n=1..20);
  • Mathematica
    Table[2^(n-1)*(1 + Sum[j*j!/2^j, {j,n-1}]), {n,30}] (* G. C. Greubel, May 02 2021 *)
  • Sage
    [2^(n-1)*sum(j*factorial(j)/2^j for j in (1..n-1)) for n in (1..30)] # G. C. Greubel, May 02 2021

Formula

a(n) = 2^(n-1) * (1 + Sum_{j=1..n-1} j*j!/2^j ).
a(n) = (n-1)!*(n-1) + 2*a(n-1) with a(1) = 1.
a(n) = Sum_{k=1..n} k*A140709(n,k).
(1 + x + 2*x^2 + 4*x^3 + 8*x^4 + ...)*(1 + 2*x + 6*x^2 + 24*x^3 + 120*x^4 + ...) = (1 + 3*x + 10*x^2 + 38*x^3 + 172*x^4 + ...) which is (Sum_{n>=0} A011782(n)*x^n) * (Sum_{n>=0} A000142(n+1)*x^n) = Sum_{n>=0} a(n+1)*x^n. - Gary W. Adamson, Feb 24 2012
a(n) = Sum_{j=0..n} (j+1)!*A011782(n-j) = (n+1)! + Sum_{j=0..n-1} 2^(n-k-1)*(j+1)!. - G. C. Greubel, May 03 2021
D-finite with recurrence a(n) +(-n-3)*a(n-1) +3*n*a(n-2) +2*(-n+2)*a(n-3)=0. - R. J. Mathar, Jul 26 2022

A347584 Triangle formed by Pascal's rule, except that the n-th row begins and ends with the n-th Lucas number.

Original entry on oeis.org

2, 1, 1, 3, 2, 3, 4, 5, 5, 4, 7, 9, 10, 9, 7, 11, 16, 19, 19, 16, 11, 18, 27, 35, 38, 35, 27, 18, 29, 45, 62, 73, 73, 62, 45, 29, 47, 74, 107, 135, 146, 135, 107, 74, 47, 76, 121, 181, 242, 281, 281, 242, 181, 121, 76, 123, 197, 302, 423, 523, 562, 523, 423, 302, 197, 123
Offset: 0

Views

Author

Noah Carey and Greg Dresden, Sep 07 2021

Keywords

Comments

Similar in spirit to the Fibonacci-Pascal triangle A074829, which uses Fibonacci numbers instead of Lucas numbers at the ends of each row.
If we consider the top of the triangle to be the 0th row, then the sum of terms in n-th row is 2*(2^(n+1) - Lucas(n+1)). This sum also equals 2*A027973(n-1) for n>0.

Examples

			The first two Lucas numbers (for n=0 and n=1) are 2 and 1, so the first two rows (again, for n=0 and n=1) of the triangle are 2 and 1, 1 respectively.
Triangle begins:
               2;
             1,  1;
           3,  2,  3;
         4,  5,  5,  4;
       7,  9, 10,  9,  7;
    11, 16, 19, 19, 16, 11;
  18, 27, 35, 38, 35, 27, 18;
		

Crossrefs

Cf. A227550, A228196 (general formula).
Fibonacci borders: A074829, A108617, A316938, A316939.

Programs

  • Mathematica
    T[n_, 0] := LucasL[n]; T[n_, n_] := LucasL[n];
    T[n_, k_] := T[n - 1, k - 1] + T[n - 1, k];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten

Formula

a(n) = 2*A074829(n+1) - A108617(n).
Showing 1-5 of 5 results.