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

A209279 First inverse function (numbers of rows) for pairing function A185180.

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 2, 3, 1, 4, 3, 2, 4, 1, 5, 3, 4, 2, 5, 1, 6, 4, 3, 5, 2, 6, 1, 7, 4, 5, 3, 6, 2, 7, 1, 8, 5, 4, 6, 3, 7, 2, 8, 1, 9, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1, 12, 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 1, 13
Offset: 1

Views

Author

Boris Putievskiy, Jan 15 2013

Keywords

Comments

The triangle equals A158946 with the first column removed. - Georg Fischer, Jul 26 2023

Examples

			The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
  1...1...2...2...3...3...4...4...
  2...1...3...2...4...3...5...4...
  3...1...4...2...5...3...6...4...
  4...1...5...2...6...3...7...4...
  5...1...6...2...7...3...8...4...
  6...1...7...2...8...3...9...4...
  7...1...8...2...9...3..10...4...
  ...
The start of the sequence as triangle array read by rows:
  1;
  1, 2;
  2, 1, 3;
  2, 3, 1, 4;
  3, 2, 4, 1, 5;
  3, 4, 2, 5, 1, 6;
  4, 3, 5, 2, 6, 1, 7;
  4, 5, 3, 6, 2, 7, 1, 8;
  ...
Row number r contains permutation numbers form 1 to r.
If r is odd (r+1)/2, (r+1)/2-1, (r+1)/2+1,...r-1, 1, r.
If r is even r/2, r/2+1, r/2-1, ... r-1, 1, r.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Abs[(2*k - 1 + (-1)^(n - k)*(2*n + 1))/4];
    Table[T[n, k], {n, 1, 15}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 14 2018, after Andrew Howroyd *)
  • PARI
    T(n, k)=abs((2*k-1+(-1)^(n-k)*(2*n+1))/4) \\ Andrew Howroyd, Dec 31 2017
    
  • Python
    # Edited by M. F. Hasler, May 30 2020
    def a(n):
       t = int((math.sqrt(8*n-7) - 1)/2);
       i = n-t*(t+1)/2;
       return int(t/2)+1+int(i/2)*(-1)**(i+t+1)

Formula

a(n) = floor((A003056(n)+2)/2)+ floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)+1).
a(n) = |A128180(n)|.
a(n) = floor((t+2)/2) + floor(i/2)*(-1)^(i+t+1), where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
T(r,2s)=s, T(r,2s-1)= r+s-1.(When read as table T(r,s) by antidiagonals.)
T(n,k) = ceiling((n + (-1)^(n-k)*k)/2) = (n+k)/2 if n-k even, otherwise (n-k+1)/2. - M. F. Hasler, May 30 2020

Extensions

Data corrected by Andrew Howroyd, Dec 31 2017

A376180 Triangle read by rows (blocks). Each row consists of a permutation of the numbers of its constituents. The length of row number n is the n-th pentagonal number n(3n-1)/2 = A000326(n); see Comments.

Original entry on oeis.org

1, 4, 5, 3, 6, 2, 13, 12, 14, 11, 15, 10, 16, 9, 17, 8, 18, 7, 30, 29, 31, 28, 32, 27, 33, 26, 34, 25, 35, 24, 36, 23, 37, 22, 38, 21, 39, 20, 40, 19, 58, 59, 57, 60, 56, 61, 55, 62, 54, 63, 53, 64, 52, 65, 51, 66, 50, 67, 49, 68, 48, 69, 47, 70, 46, 71, 45, 72, 44, 73, 43, 74, 42, 75, 41, 101, 102, 100, 103, 99, 104, 98, 105, 97, 106, 96, 107
Offset: 1

Views

Author

Boris Putievskiy, Sep 14 2024

Keywords

Comments

A209278 presents an algorithm for generating permutations.
The sequence is an intra-block permutation of integer positive numbers.

Examples

			Triangle begins:
     k =  1   2   3   4   5   6   7   8   9  10  11  12
  n=1:    1;
  n=2:    4,  5,  3,  6,  2;
  n=3:   13, 12, 14, 11, 15, 10, 16,  9, 17,  8, 18,  7;
Subtracting (n-1)^2*n/2 from each term in row n is a permutation of 1 .. n(3n-1)/2:
  1;
  3,4,2,5,1;
  7,6,8,5,9,4,10,3,11,2,12,1;
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[Max[x/.NSolve[x^2 (x+1)-2 n==0,x,Reals]]];
    R=n-((L-1)^2)*L/2; P=Which[OddQ[R]&&OddQ[L*(3*L-1)/2],(L*(3*L-1)/2-R+2)/2,OddQ[R]&&EvenQ[L*(3*L-1)/2],(R+L*(3*L-1)/2+1)/2,EvenQ[R]&&OddQ[L*(3*L-1)/2],Ceiling[(L*(3*L-1)/2+1)/2]+R/2, EvenQ[R]&&EvenQ[L*(3*L-1)/2],Ceiling[(L*(3*L-1)/2+1)/2]-R/2 ];
    Result=P+(L-1)^2*L/2; Result]
    Nmax=18; Table[a[n],{n,1,Nmax}]

Formula

Linear sequence:
a(n) = P(n) + (L(n)-1)^2*L(n)/2. a(n) = P(n) + A002411(L(n)-1), where P = (L(n)(3L(n) - 1)/2 - R(n) + 2)/2 if R(n) is odd and L(n)(3L(n) - 1)/2 is odd, P = (R(n) + L(n)(3L(n) - 1)/2 + 1)/2 if R(n) is odd and L(n)(3L(n) - 1)/2 is even, P = ceiling((L(n)(3L(n) - 1)/2 + 1)/2) + R(n)/2 if R(n) is even and L(n)(3L(n) - 1)/2 is odd, P = ceiling((L(n)(3L(n) - 1)/2 + 1)/2) - R(n)/2 if R(n) is even and L(n)(3L(n) - 1)/2 is even. L(n) = ceiling(x(n)), x(n) is largest real root of the equation x^2*(x+1)-2*n = 0.
Triangular array T(n,k) for 1 <= k <= n(3n-1)/2 (see Example):
T(n,k) = P(n,k) + (n-1)^2*n/2, T(n,k) = P(n,k) + A002411(n-1), where P(n,k) = (n(3n - 1)/2 - k + 2)/2 if k is odd and n(3n - 1)/2 is odd,
P(n,k) = (k + n(3n - 1)/2 + 1)/2 if k is odd and n(3n - 1)/2 is even, P(n,k) = ceiling((n(3n - 1)/2 + 1)/2) + k/2 if k is even and n(3n - 1)/2 is odd, P(n,k) = ceiling((n(3n - 1)/2 + 1)/2) - k/2 if k is even and n(3n - 1)/2 is even.

A214928 A209293 as table read layer by layer clockwise.

Original entry on oeis.org

1, 2, 4, 3, 5, 9, 14, 7, 6, 8, 12, 17, 23, 20, 11, 10, 13, 19, 26, 34, 43, 30, 27, 16, 15, 18, 24, 31, 39, 48, 58, 53, 38, 35, 22, 21, 25, 33, 42, 52, 63, 75, 88, 69, 64, 47, 44, 29, 28, 32, 40, 49, 59, 70, 82, 95, 109, 102, 81, 76, 57, 54, 37, 36, 41, 51, 62
Offset: 1

Views

Author

Boris Putievskiy, Mar 11 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). The order of the list:
T(1,1)=1;
T(1,2), T(2,2), T(2,1);
. . .
T(1,n), T(2,n), ... T(n-1,n), T(n,n), T(n,n-1), ... T(n,1);
. . .

Examples

			The start of the sequence as table:
  1....2...5...8..13..18...
  3....4...9..12..19..24...
  6....7..14..17..26..31...
  10..11..20..23..34..39...
  15..16..27..30..43..48...
  21..22..35..38..53..58...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  2,4,3;
  5,9,14,7,6;
  8,12,17,23,20,11,10;
  13,19,26,34,43,30,27,16,15;
  18,24,31,39,48,58,53,38,35,22,21;
  . . .
Row number r contains 2*r-1 numbers.
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(n-1)))+1
    i=min(t,n-(t-1)**2)
    j=min(t,t**2-n+1)
    m1=int((i+j)/2)+int(i/2)*(-1)**(2*i+j-1)
    m2=int((i+j+1)/2)+int(i/2)*(-1)**(2*i+j-2)
    result=(m1+m2-1)*(m1+m2-2)/2+m1

Formula

As table
T(n,k) = n*n/2+4*(floor((k-1)/2)+1)*n+ceiling((k-1)^2/2), n,k > 0.
As linear sequence
a(n)= (m1+m2-1)*(m1+m2-2)/2+m1, where m1=floor((i+j)/2) + floor(i/2)*(-1)^(2*i+j-1), m2=int((i+j+1)/2)+int(i/2)*(-1)^(2*i+j-2), where i=min(t; n-(t-1)^2), j=min(t; t^2-n+1), t=floor(sqrt(n-1))+1.

A214929 A209293 as table read layer by layer - layer clockwise, layer counterclockwise and so on.

Original entry on oeis.org

1, 3, 4, 2, 5, 9, 14, 7, 6, 10, 11, 20, 23, 17, 12, 8, 13, 19, 26, 34, 43, 30, 27, 16, 15, 21, 22, 35, 38, 53, 58, 48, 39, 31, 24, 18, 25, 33, 42, 52, 63, 75, 88, 69, 64, 47, 44, 29, 28, 36, 37, 54, 57, 76, 81, 102, 109, 95, 82, 70, 59, 49, 40, 32, 41, 51, 62
Offset: 1

Views

Author

Boris Putievskiy, Mar 11 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Table read by boustrophedonic ("ox-plowing") method. Let m be natural number. The order of the list:
T(1,1)=1;
T(2,1), T(2,2), T(1,2);
. . .
T(1,2*m+1), T(2,2*m+1), ... T(2*m,2*m+1), T(2*m+1,2*m+1), T(2*m+1,2*m), ... T(2*m+1,1);
T(2*m,1), T(2*m,2), ... T(2*m,2*m-1), T(2*m,2*m), T(2*m-1,2*m), ... T(1,2*m);
. . .
The first row is layer read clockwise, the second row is layer counterclockwise.

Examples

			The start of the sequence as table:
  1....2...5...8..13..18...
  3....4...9..12..19..24...
  6....7..14..17..26..31...
  10..11..20..23..34..39...
  15..16..27..30..43..48...
  21..22..35..38..53..58...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  3,4,2;
  5,9,14,7,6;
  10,11,20,23,17,12,8;
  13,19,26,34,43,30,27,16,15;
  21,22,35,38,53,58,48,39,31,24,18;
  . . .
Row number r contains 2*r-1 numbers.
		

Crossrefs

Cf. A081344, A209293, A209279, A209278, A185180; table T(n,k) contains: in rows A000982, A097063; in columns A000217, A000124, A000096, A152948, A034856, A152950, A055998, A000982, A097063.

Programs

  • Python
    t=int((math.sqrt(n-1)))+1
    i=(t % 2)*min(t,n-(t-1)**2) + ((t+1) % 2)*min(t,t**2-n+1)
    j=(t % 2)*min(t,t**2-n+1) + ((t+1) % 2)*min(t,n-(t-1)**2)
    m1=int((i+j)/2)+int(i/2)*(-1)**(2*i+j-1)
    m2=int((i+j+1)/2)+int(i/2)*(-1)**(2*i+j-2)
    result=(m1+m2-1)*(m1+m2-2)/2+m1

Formula

As table
T(n,k) = n*n/2+4*(floor((k-1)/2)+1)*n+ceiling((k-1)^2/2), n,k > 0.
As linear sequence
a(n)= (m1+m2-1)*(m1+m2-2)/2+m1, where
m1=floor((i+j)/2) + floor(i/2)*(-1)^(2*i+j-1), m2=int((i+j+1)/2)+int(i/2)*(-1)^(2*i+j-2),
where i=(t mod 2)*min(t; n-(t-1)^2) + (t+1 mod 2)*min(t; t^2-n+1), j=(t mod 2)*min(t; t^2-n+1) + (t+1 mod 2)*min(t; n-(t-1)^2), t=floor(sqrt(n-1))+1.

A378127 Inverse permutation to A377137.

Original entry on oeis.org

1, 3, 4, 2, 6, 5, 10, 9, 11, 8, 12, 7, 14, 15, 13, 20, 21, 19, 22, 18, 23, 17, 24, 16, 27, 26, 28, 25, 35, 34, 36, 33, 37, 32, 38, 31, 39, 30, 40, 29, 43, 44, 42, 45, 41, 53, 54, 52, 55, 51, 56, 50, 57, 49, 58, 48, 59, 47, 60, 46, 64, 63, 65, 62, 66, 61, 76, 75, 77, 74, 78, 73, 79, 72, 80, 71, 81, 70, 82, 69, 83, 68, 84, 67, 88, 89, 87, 90, 86, 91
Offset: 1

Views

Author

Boris Putievskiy, Nov 17 2024

Keywords

Comments

Array read by rows (blocks). Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block.
Row n has length A064455(n). The sequence A064455 is non-monotonic.
Subtracting (n^2 - n)/2 if n is even from each term in row n produces a permutation of 1 .. 3n/2. Subtracting (n^2 - 1)/2 if n is odd from each term in row n produces a permutation of 1 .. (n+1)/2.
These permutations are inverses of the corresponding permutations from A377137. The algorithm used to generate them is described in A209278.
The sequence is an intra-block permutation of the positive integers.

Examples

			Array begins:
     k =  1   2   3   4   5   6
  n=1:    1;
  n=2:    3,  4,  2;
  n=3:    6,  5;
  n=4:   10,  9, 11,  8, 12, 7;
 The triangular arrays alternate by row: n=1 and n=3 comprise one, and n=2 and n=4 comprise the other. Subtracting 1, 4, and 6 from the elements of rows 2, 3, and 4, respectively, produces permutations:
  1;
  2, 3, 1;
  2, 1;
  4, 3, 5, 2, 6, 1;
  ...
These permutations are the inverses of those in Example A377137, listed in the same order.
(2,3,1)^(-1) = (3,1,2); (2,1)^(-1) = (2,1); (4,3,5,2,6,1)^(-1) = (6,4,2,1,3,5).
		

Crossrefs

Programs

  • Mathematica
    b[n_]:=(4n+1+(2n-1)*(-1)^n)/4;P[n_,k_]:=If[EvenQ[b[n]-k],(b[n]-k+2)/2,(b[n]+k+1)/2];Res[n_,k_]:=P[n,k]+(-(-1)^n*n+(-1)^n+2 n^2-n-1)/4;
    Nmax=4;resultTable=Table[Res[n,k],{n,1,Nmax},{k,1,b[n]}]//Flatten

Formula

Array T(n,k) (see Example):
T(n, k) = P(n, k) + A265225(n-1), where
P(n, k) = (b(n) - k + 2)/2 if mod(b(n) - k, 2) = 0,
P(n, k) = (b(n) + k + 1)/2 if mod(b(n) - k, 2) = 1.
b(n) = (4n + 1 + (2n - 1) * (-1)^n)/4 is the length of the row n.

A376276 Table T(n, k) n > 0, k > 2 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. The length of the row number n in column k is equal to the n-th k-gonal number A086270.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Sep 18 2024

Keywords

Comments

A209278 presents an algorithm for generating permutations.
The sequence is an intra-block permutation of integer positive numbers.

Examples

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

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 45.

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,P,Res,result},L=Ceiling[Max[x/.NSolve[x^3*(k-2)+3*x^2-x*(k-5)-6*n==0,x,Reals]]];
    R=n-(((L-1)^3)*(k-2)+3*(L-1)^2-(L-1)*(k-5))/6;P=Which[OddQ[R]&&OddQ[k*L*(L-1)/2-L^2+2*L],((k*L*(L-1)/2-L^2+2*L+1-R)+1)/2,OddQ[R]&&EvenQ[k*L*(L-1)/2-L^2+2*L],(R+k*L*(L-1)/2-L^2+2*L+1)/2,EvenQ[R]&&OddQ[k*L*(L-1)/2-L^2+2*L],Ceiling[(k*L*(L-1)/2-L^2+2*L+1)/2]+R/2,EvenQ[R]&&EvenQ[k*L*(L-1)/2-L^2+2*L],Ceiling[(k*L*(L-1)/2-L^2+2*L+1)/2]-R/2];
    Res=P+((L-1)^3*(k-2)+3*(L-1)^2-(L-1)*(k-5))/6;result=Res;result]
    Nmax=6;Table[T[n,k],{n,1,Nmax},{k,3,Nmax+2}]

Formula

T(n,k) = P(n,k) + ((L(n,k)-1)^3*(k-2)+3*(L(n,k)-1)^2-(L(n,k)-1)*(k-5))/6, where L(n,k) = ceiling(x(n,k)), x(n,k) is largest real root of the equation x^3*(k - 2) + 3*x^2 - x*(k - 5) - 6*n = 0. R(n,k) = n - ((L(n,k) - 1)^3*(k-2)+3*(L(n,k)-1)^2-(L(n,k)-1)*(k-5))/6. P(n,k) = ((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 2 - R(n,k)) / 2 if R is odd and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is odd, P(n,k) = (R(n,k) + (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2 if R is odd and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is even, P(n,k) = ceiling(((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2) + (R(n,k) / 2) if R is even and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is odd, P(n,k) = ceiling(((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2) - (R(n,k) / 2) if R is even and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is even.
T(1,n) = A000012(n). T(2,n) = A004526(n+7). T(3,n) = A028242(n+6). T(4,n) = A084964(n+5). T(n-2,n) = A000027(n) for n > 3. L(n,3) = A360010(n). L(n,4) = A074279(n).

A376353 Table T(n, k) n > 0, k > 2 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. The length of the row number n in column k is equal to the n-th k-pyramidal number A261720.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Sep 21 2024

Keywords

Comments

A209278 presents an algorithm for generating permutations.
The sequence is an intra-block permutation of integer positive numbers.

Examples

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

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 93.

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,result},L=Ceiling[Max[x/.NSolve[(k-2)*x^4+2*k*x^3+(14-k)*x^2+(12-2*k)*x-24*n==0,x,Reals]]]; R=n-((k-2)*(L-1)^4+2*k*(L-1)^3+(14-k)*(L-1)^2+(12-2*k)*(L-1))/24; P=Which[OddQ[R]&&OddQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],((L^3*(k-2)+3*L^2-L*(k-5))/6+2-R)/2,OddQ[R]&&EvenQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],(R+(L^3*(k-2)+3*L^2-L*(k-5))/6+1)/2,EvenQ[R]&&OddQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],Ceiling[((L^3*(k-2)+3*L^2-L*(k-5))/6+1)/2]+R/2,EvenQ[R]&&EvenQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],Ceiling[((L^3*(k-2)+3*L^2-L*(k-5))/6+1)/2]-R/2]; Res= P +((k-2)*(L-1)^4+2*k*(L-1)^3+(14-k)*(L-1)^2+(12-2*k)*(L-1))/24; result=Res] Nmax=6; Table[T[n,k],{n,1,Nmax},{k,3,Nmax+2}]

Formula

T(n,k) = P(n,k) + ((k-2)*(L(n,k)-1)^4+2*k*(L(n,k)-1)^3+(14-k)*(L(n,k)-1)^2+(12-2*k)*(L(n,k)-1))/24, where L(n,k) = ceiling(x(n,k)), x(n,k) is largest real root of the equation (k-2)*x^4+2*k*x^3+(14-k)*x^2+(12-2*k)*x-24*n = 0. R(n,k) = n - ((k-2)*(L(n,k)-1)^4+2*k*(L(n,k)-1)^3+(14-k)*(L(n,k)-1)^2+(12-2*k)*(L(n,k)-1))/24. P(n,k) = ((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+2-R(n,k))/2 if R(n,k) is odd and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is odd, P(n,k) = ((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+1)+R(n,k))/2 if R(n,k) is odd and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is even, P = ceiling(((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+1)/2)+R(n,k)/2) if R(n,k) is even and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is odd, P = ceiling(((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+1)/2)-R(n,k)/2) if R(n,k) is even and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is even.
T(1,n) = A000012(n). T(2,n) = A004526(n+8). T(3,n) = A028242(n+7). T(4,n) = A084964(n+6). T(5,n) = A168230(n+5). T(n-2,n) = 4*A000012(n) for n > 3. T(n-1,n) = A000027(n) for n > 2.
Showing 1-7 of 7 results.