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.

A104633 Triangle T(n,k) = k*(k-n-1)*(k-n-2)/2 read by rows, 1<=k<=n.

Original entry on oeis.org

1, 3, 2, 6, 6, 3, 10, 12, 9, 4, 15, 20, 18, 12, 5, 21, 30, 30, 24, 15, 6, 28, 42, 45, 40, 30, 18, 7, 36, 56, 63, 60, 50, 36, 21, 8, 45, 72, 84, 84, 75, 60, 42, 24, 9, 55, 90, 108, 112, 105, 90, 70, 48, 27, 10, 66, 110, 135
Offset: 1

Views

Author

Gary W. Adamson, Mar 18 2005

Keywords

Comments

The triangle can be constructed multiplying the triangle A(n,k)=n-k+1 (if 1<=k<=n, else 0) by the triangle B(n,k) =k (if 1<=k<=n, else 0).
Swapping the two triangles of this matrix product would generate A104634.

Examples

			First few rows of the triangle:
  1;
  3,  2;
  6,  6,  3;
 10, 12,  9,  4;
 15, 20, 18, 12,  5;
 21, 30, 30, 24, 15,  6;
 28, 42, 45, 40, 30, 18,  7;
 36, 56, 63, 60, 50, 36, 21, 8;
 ...
e.g. Col. 3 = 3 * (1, 3, 6, 10, 15...) = 3, 9, 18, 30, 45...
		

Crossrefs

Cf. A062707, A158824, A104634, A001296, A000332 (row sums).

Programs

  • Magma
    [[k*(k-n-1)*(k-n-2)/2: k in [1..n]]: n in [1..20]]; // G. C. Greubel, Aug 12 2018
  • Maple
    A104633 := proc(n,k) k*(k-n-1)*(k-n-2)/2 ; end proc:
    seq(seq(A104633(n,k),k=1..n),n=1..16) ; # R. J. Mathar, Mar 03 2011
  • Mathematica
    Table[k*(k-n-1)*(k-n-2)/2, {n, 1, 20}, {k, 1, n}] // Flatten (* G. C. Greubel, Aug 12 2018 *)
  • PARI
    for(n=1,20, for(k=1,n, print1(k*(k-n-1)*(k-n-2)/2, ", "))) \\ G. C. Greubel, Aug 12 2018
    

Formula

G.f.: x*y/((1 - x)^3*(1 - x*y)^2). - Stefano Spezia, May 22 2023

A158824 Triangle T(n,k) = A000292(n) if k = 1 otherwise (k-1)*(n-k+1)*(n-k+2)/2, read by rows.

Original entry on oeis.org

1, 4, 1, 10, 3, 2, 20, 6, 6, 3, 35, 10, 12, 9, 4, 56, 15, 20, 18, 12, 5, 84, 21, 30, 30, 24, 15, 6, 120, 28, 42, 45, 40, 30, 18, 7, 165, 36, 56, 63, 60, 50, 36, 21, 8, 220, 45, 72, 84, 84, 75, 60, 42, 24, 9, 286, 55, 90, 108, 112, 105, 90, 70, 48, 27, 10, 364, 66, 110, 135, 144, 140, 126, 105, 80, 54, 30, 11
Offset: 1

Views

Author

Keywords

Comments

The triangle can also be defined by multiplying the triangles A(n,k)=1 and A158823(n,k), that is, this here are the partial column sums of A158823.

Examples

			First few rows of the triangle are:
    1;
    4,  1;
   10,  3,   2;
   20,  6,   6,   3;
   35, 10,  12,   9,   4;
   56, 15,  20,  18,  12,   5;
   84, 21,  30,  30,  24,  15,   6;
  120, 28,  42,  45,  40,  30,  18,   7;
  165, 36,  56,  63,  60,  50,  36,  21,   8;
  220, 45,  72,  84,  84,  75,  60,  42,  24,  9;
  286, 55,  90, 108, 112, 105,  90,  70,  48, 27, 10;
  364, 66, 110, 135, 144, 140, 126, 105,  80, 54, 30, 11;
  455, 78, 132, 165, 180, 180, 168, 147, 120, 90, 60, 33, 12;
  ...
		

Crossrefs

Row sums: A000332.

Programs

  • Magma
    A158824:= func< n,k | k eq 1 select Binomial(n+2,3) else (k-1)*Binomial(n-k+2,2) >; [A158824(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 01 2021
    
  • Mathematica
    T[n_, k_]:= If[k==1, Binomial[n+2, 3], (k-1)*Binomial[n-k+2, 2]];
    Table[T[n, k], {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Apr 01 2021 *)
  • Sage
    def A158824(n,k): return binomial(n+2,3) if k==1 else (k-1)*binomial(n-k+2,2)
    flatten([[A158824(n,k) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Apr 01 2021

Formula

T(n,k) = binomial(n+2,3) if k = 1 otherwise (k-1)*binomial(n-k+2, 2).
Sum_{k=1..n} T(n, k) = binomial(n+3, 4) = A000332(n+3). - G. C. Greubel, Apr 01 2021

A375797 Table T(n, k) read by upward antidiagonals. The sequences in each column k is a triangle read by rows (blocks), where each row is a permutation of the numbers of its constituents. Row number n in column k has length n*k = A003991(n,k); see Comments.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 6, 3, 2, 1, 5, 5, 1, 3, 5, 4, 4, 4, 2, 2, 1, 7, 6, 8, 4, 3, 5, 7, 9, 7, 6, 5, 4, 3, 2, 1, 8, 11, 7, 11, 1, 4, 5, 7, 9, 10, 9, 5, 7, 6, 2, 4, 3, 2, 1, 15, 10, 9, 9, 14, 6, 3, 5, 7, 9, 11, 12, 8, 18, 8, 8, 7, 6, 4, 4, 3, 2, 1, 13, 12, 11, 10, 12, 17, 1, 6, 5, 7, 9, 11, 13, 14, 13, 16, 6, 10, 9, 8, 2, 6, 5, 4, 3, 2, 1
Offset: 1

Views

Author

Boris Putievskiy, Aug 29 2024

Keywords

Comments

A208233 presents an algorithm for generating permutations, where each generated permutation is self-inverse.
The sequence in each column k possesses two properties: it is both a self-inverse permutation and an intra-block permutation of natural numbers.

Examples

			Table begins:
    k=    1   2   3   4   5   6
  -----------------------------------
  n= 1:   1,  1,  3,  1,  5,  1, ...
  n= 2:   2,  2,  2,  3,  2,  5, ...
  n= 3:   3,  3,  1,  2,  3,  3, ...
  n= 4:   6,  5,  4,  4,  4,  4, ...
  n= 5:   5,  4,  8,  5,  1,  2, ...
  n= 6:   4,  6,  6, 11,  6,  6, ...
  n= 7:   7,  7,  7,  7, 14,  7, ...
  n= 8:   9, 11,  5,  9,  8, 17, ...
  n= 9:   8,  9,  9,  8, 12,  9, ...
  n= 10: 10, 10, 18, 10, 10, 15, ...
  n= 11: 15,  8, 11,  6, 11, 11, ...
  n= 12: 12, 12, 16, 12,  9, 13, ...
  n= 13: 13, 13, 13, 13, 13, 12, ...
  n= 14: 14, 19, 14, 23,  7, 14, ...
  n= 15: 11, 15, 15, 15, 15, 10, ...
  n= 16: 16, 17, 12, 21, 30, 16, ...
  n= 17: 20, 16, 17, 17, 17,  8, ...
  n= 18: 18, 18, 10, 19, 28, 18, ...
     ... .
In column 3, the first 3 blocks have lengths 3,6 and 9. In column 6, the first 2 blocks have lengths 6 and 12. Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
  1;
  2,1;
  3,2,3;
  6,3,2,1;
  5,5,1,3,5;
  4,4,4,2,2,1;
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,P,result},L=Ceiling[(Sqrt[8*n*k+k^2]-k)/(2*k)]; R=n-k*(L-1)*L/2; P=(((-1)^Max[R,k*L+1-R]+1)*R-((-1)^Max[R,k*L+1-R]-1)*(k*L+1-R))/2; result=P+k*(L-1)*L/2]
    Nmax=18; Table[T[n,k],{n,1,Nmax},{k,1,Nmax}]

Formula

T(n,k) = P(n,k) + k*(L(n,k)-1)*L(n,k)/2 = P(n,k) + A062707(L(n-1),k), where L(n,k) = ceiling((sqrt(8*n*k+k^2)-k)/(2*k)), R(n,k) = n-k*(L(n,k)-1)*L(n,k)/2, P(n,k) = (((-1)^max(R(n,k),k*L(n,k)+1-R(n,k))+1)*R(n,k)-((-1)^max(R(n,k),k*L(n,k)+1-R(n,k))-1)*(k*L(n,k)+1-R(n,k)))/2.
T(n,1) = A188568(n). T(1,k) = A093178(k). T(n,n) = A124625(n). L(n,1) = A002024(n). L(n,2) = A000194(n). L(n,3) = A111651(n). L(n,4) = A371355(n). R(n,1) = A002260(n). R(n,2) = A074294(n).
Showing 1-3 of 3 results.