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.

A375725 Table T(n, k) read by upward antidiagonals. The sequences in each column k is a triangle read by rows, where each row is a permutation of the numbers of its constituents; see Comments.

Original entry on oeis.org

1, 3, 1, 2, 2, 6, 4, 3, 2, 10, 5, 4, 4, 2, 1, 6, 9, 3, 8, 14, 1, 10, 6, 5, 4, 3, 20, 28, 8, 7, 1, 6, 12, 3, 2, 36, 9, 8, 7, 5, 5, 18, 26, 2, 1, 7, 5, 20, 7, 10, 5, 4, 34, 44, 1
Offset: 1

Views

Author

Boris Putievskiy, Aug 25 2024

Keywords

Comments

Generalization of the Cantor numbering method for k (k > 1) adjacent diagonals. In this approach, column number k combines k neighboring diagonals. Block number n in column k has length k^2*n - k*(k-1)/2 = A360665(n,k) for n, k > 0.
A208234 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,  6, 10,  1,  1, ...
  n= 2:   3,  2,  2,  2, 14, 20, ...
  n= 3:   2,  3,  4,  8,  3,  3, ...
  n= 4:   4,  4,  3,  4, 12, 18, ...
  n= 5:   5,  9,  5,  6,  5,  5, ...
  n= 6:   6,  6,  1,  5, 10, 16, ...
  n= 7:  10,  7,  7,  7,  7,  7, ...
  n= 8:   8,  8, 20,  3,  8, 14, ...
  n= 9:   9,  5,  9,  9,  9,  9, ...
  n=10:   7, 10, 18,  1,  6, 12, ...
  n=11:  11, 11, 11, 36, 11, 11, ...
  n=12:  14, 20, 16, 12,  4, 10, ...
  n=13:  13, 13, 13, 34, 13, 13, ...
  n=14:  12, 18, 14, 14,  2,  8, ...
  n=15:  15, 15, 15, 32, 15, 15, ...
  n=16:  21, 16, 12, 16, 55,  6, ...
  n=17:  17, 17, 17, 30, 17, 17, ...
  n=18:  19, 14, 10, 18, 53,  4, ...
  n=19:  18, 19, 19, 28, 19, 19, ...
  n=20:  20, 12,  8, 20, 51,  2, ...
  n=21:  16, 21, 21, 26, 21, 21, ...
       ... .
In column 2, the first 3 blocks have lengths 3,7 and 11. In column 3, the first 2 blocks have lengths 6 and 15. In column 6, the first block has a length of 21.
Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
  1;
  3, 1;
  2, 2, 6;
  4, 3, 2, 10;
  5, 4, 4, 2, 1;
  6, 9, 3, 8, 14, 1;
		

Crossrefs

Programs

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

Formula

T(n,k) = P(n,k) + k*(L(n,k) - 1)*(k*(L(n,k) - 1) + 1)/2 = P(n,k) + A342719(L(n,k) - 1,k)), where L(n,k) = ceiling((sqrt(8*n+1)-1)/(2*k)), R(n,k) = n - k*(L(n,k)-1)*(k*(L(n,k)-1)+1)/2, P(n,k) = - max(R(n,k) , k^2*L(n,k) - k(k-1)/2 + 1 - R(n,k) ) * ((-1)^R(n,k) - 1) / 2 + min(R(n,k) , k^2*L(n,k) - k(k-1)/2 + 1 - R(n,k) ) * ((-1)^R(n,k) + 1) / 2 if 2R(n,k) ≥k^2*L - k(k-1)/2 + 1, P(n,k) = max(R(n,k) , k^2*L(n,k) - k(k-1)/2 + 1 - R(n,k) ) * ((-1)^(k^2*L(n,k) - k(k-1)/2 + 1 - R) + 1) / 2 - min(R, k^2*L(n,k) - k(k-1)/2 + 1 - R) * ((-1)^(k^2*L(n,k) - k(k-1)/2 + 1 - R(n,k) ) - 1) / 2 if 2R < k^2*L(n,k) - k(k-1)/2. + 1.

A342758 Array read by ascending antidiagonals: T(k, n) is the maximum value of the magic constant in a perimeter-magic k-gon of order n.

Original entry on oeis.org

12, 15, 23, 19, 30, 37, 22, 37, 48, 54, 26, 44, 60, 71, 74, 29, 51, 71, 88, 97, 97, 33, 58, 83, 105, 121, 128, 123, 36, 65, 94, 122, 144, 159, 162, 152, 40, 72, 106, 139, 168, 190, 202, 201, 184, 43, 79, 117, 156, 191, 221, 241, 250, 243, 219, 47, 86, 129, 173, 215, 252, 281, 299, 303, 290, 257
Offset: 3

Views

Author

Stefano Spezia, Mar 21 2021

Keywords

Examples

			The array begins:
k\n|  3   4   5    6    7 ...
---+---------------------
3  | 12  23  37   54   74 ...
4  | 15  30  48   71   97 ...
5  | 19  37  60   88  121 ...
6  | 22  44  71  105  144 ...
7  | 26  51  83  122  168 ...
...
		

Crossrefs

Cf. A017005 (n = 4), A135503 (diagonal), A341740 (k = 3), A342719, A342757 (minimum).

Programs

  • Mathematica
    T[k_,n_]:= (n+k(n^2-2)+(Mod[k,2]-1)Mod[n,2])/2; Table[T[k+3-n,n],{k,3,13},{n,3,k}]//Flatten

Formula

G.f.: (- x^2*(2*y^2 + y - 1) - x*(y^2 + 2*y - 1) + (y - 1)*y^2)/((x - 1)^2*(x + 1)*(y - 1)^3*(y + 1)).
T(k, n) = (n^2/2 - 1)*k + n/2 if n is even or both n and k are odd.
T(k, n) = (n^2/2 - 1)*k + (n - 1)/2 if n is odd and k is even.
T(k, n) = (n + k*(n^2 - 2) + ((k mod 2) - 1)*(n mod 2))/2.

A342757 Array read by ascending antidiagonals: T(k, n) is the minimum value of the magic constant in a perimeter-magic k-gon of order n.

Original entry on oeis.org

9, 12, 17, 14, 22, 28, 17, 27, 37, 42, 19, 32, 45, 55, 59, 22, 37, 54, 68, 78, 79, 24, 42, 62, 81, 96, 104, 102, 27, 47, 71, 94, 115, 129, 135, 128, 29, 52, 79, 107, 133, 154, 167, 169, 157, 32, 57, 88, 120, 152, 179, 200, 210, 208, 189, 34, 62, 96, 133, 170, 204, 232, 251, 258, 250, 224
Offset: 3

Views

Author

Stefano Spezia, Mar 21 2021

Keywords

Examples

			The array begins:
k\n|  3   4   5   6    7 ...
---+------------------------
3  |  9  17  28  42   59 ...
4  | 12  22  37  55   78 ...
5  | 14  27  45  68   96 ...
6  | 17  32  54  81  115 ...
7  | 19  37  62  94  133 ...
...
		

Crossrefs

Cf. A016873 (n = 4), A285009 (k = 3), A342719, A342758 (maximum).

Programs

  • Mathematica
    T[k_,n_]:= ((1-Mod[k,2])Mod[n,2]+k*(n^2-2*n+2)+n)/2; Table[T[k+3-n,n],{k,3,13},{n,3,k}]//Flatten

Formula

G.f.: (x^2*(-3*y^3 + 2*y - 1) - x*(2*y^3 + y^2 - 2*y + 1) + (y - 1)*y)/((x - 1)^2*(x + 1)*(y - 1)^3*(y + 1)).
T(k, n) = (n^2/2 - n + 1)*k + n/2 if n is even or both n and k are odd.
T(k, n) = (n^2/2 - n + 1)*k + (n + 1)/2 if n is odd and k is even.
T(k, n) = ((1 - (k mod 2))*(n mod 2) + k*(n^2 - 2*n + 2) + n)/2.
Showing 1-3 of 3 results.