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

A199855 Inverse permutation to A210521.

Original entry on oeis.org

1, 4, 2, 5, 3, 6, 11, 7, 12, 8, 13, 9, 14, 10, 15, 22, 16, 23, 17, 24, 18, 25, 19, 26, 20, 27, 21, 28, 37, 29, 38, 30, 39, 31, 40, 32, 41, 33, 42, 34, 43, 35, 44, 36, 45, 56, 46, 57, 47, 58, 48, 59, 49, 60, 50, 61, 51, 62, 52, 63, 53, 64, 54, 65, 55, 66, 79
Offset: 1

Views

Author

Boris Putievskiy, Feb 04 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.
Enumeration table T(n,k). The order of the list:
T(1,1)=1;
T(2,1), T(2,2), T(1,2), T(1,3), T(3,1),
...
T(2,n-1), T(4,n-3), T(6,n-5), ..., T(n,1),
T(2,n), T(4,n-2), T(6,n-4), ..., T(n,2),
T(1,n), T(3,n-2), T(5,n-4), ..., T(n-1,2),
T(1,n+1), T(3,n-1), T(5,n-3), ..., T(n+1,1),
...
The order of the list elements of adjacent antidiagonals. Let m be a positive integer.
Movement by antidiagonal {T(1,2*m), T(2*m,1)} from T(2,2*m-1) to T(2*m,1) length of step is 2,
movement by antidiagonal {T(1,2*m+1), T(2*m+1,1)} from T(2,2*m) to T(2*m,2) length of step is 2,
movement by antidiagonal {T(1,2*m), T(2*m,1)} from T(1,2*m) to T(2*m-1,2) length of step is 2,
movement by antidiagonal {T(1,2*m+1), T(2*m+1,1)} from T(1,2*m+1) to T(2*m+1,1) length of step is 2.
Table contains:
row 1 is alternation of elements A001844 and A084849,
row 2 is alternation of elements A130883 and A058331,
row 3 is alternation of elements A051890 and A096376,
row 4 is alternation of elements A033816 and A005893,
row 6 is alternation of elements A100037 and A093328;
row 5 accommodates elements A097080 in odd places,
row 7 accommodates elements A137882 in odd places,
row 10 accommodates elements A100038 in odd places,
row 14 accommodates elements A100039 in odd places;
column 1 is A093005 and alternation of elements A000384 and A001105,
column 2 is alternation of elements A046092 and A014105,
column 3 is A105638 and alternation of elements A014106 and A056220,
column 4 is alternation of elements A142463 and A014107,
column 5 is alternation of elements A091823 and A054000,
column 6 is alternation of elements A090288 and |A168244|,
column 8 is alternation of elements A059993 and A033537;
column 7 accommodates elements A071355 in odd places,
column 9 accommodates elements |A147973| in even places,
column 10 accommodates elements A139570 in odd places,
column 13 accommodates elements A130861 in odd places.

Examples

			The start of the sequence as table:
   1,  4,  5,  11,  13,  22,  25,  37,  41,  56,  61, ...
   2,  3,  7,   9,  16,  19,  29,  33,  46,  51,  67, ...
   6, 12, 14,  23,  26,  38,  42,  57,  62,  80,  86, ...
   8, 10, 17,  20,  30,  34,  47,  52,  68,  74,  93, ...
  15, 24, 27,  39,  43,  58,  63,  81,  87, 108, 115, ...
  18, 21, 31,  35,  48,  53,  69,  75,  94, 101. 123, ...
  28, 40, 44,  59,  64,  82,  88, 109, 116, 140, 148, ...
  32, 36, 49,  54,  70,  76,  95, 102, 124, 132, 157, ...
  45, 60, 65,  83,  89, 110, 117, 141, 149, 176, 185, ...
  50, 55, 71,  77,  96, 103, 125, 133, 158, 167, 195, ...
  66, 84, 90, 111, 118, 142, 150, 177, 186, 216, 226, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   4,  2;
   5,  3,  6;
  11,  7, 12,  8;
  13,  9, 14, 10, 15;
  22, 16, 23, 17, 24, 18;
  25, 19, 26, 20, 27, 21, 28;
  37, 29, 38, 30, 39, 31, 40, 32;
  41, 33, 42, 34, 43, 35, 44, 36, 45;
  56, 46, 57, 47, 58, 48, 59, 49, 60, 50;
  61, 51, 62, 52, 63, 53, 64, 54, 65, 55, 66;
  ...
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of  triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of  triangle array, located above.
   1;
   4, 2, 5, 3, 6;
  11, 7,12, 8,13, 9,14,10,15;
  22,16,23,17,24,18,25,19,26,20,27,21,28;
  37,29,38,30,39,31,40,32,41,33,42,34,43,35,44,36,45;
  56,46,57,47,58,48,59,49,60,50,61,51,62,52,63,53,64,54,65,55,66;
  ...
Row number r contains permutation numbers 4*r-3 from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-3*r+2,2*r*r-5*r+4, 2*r*r-3*r+3, 2*r*r-5*r+5, 2*r*r-3*r+4, 2*r*r-5*r+6, ..., 2*r*r-3*r+1, 2*r*r-r.
...
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=(2*j**2+(4*i-5)*j+2*i**2-3*i+2+(2+(-1)**j)*((1-(t+1)*(-1)**i)))/4

Formula

T(n,k) = (2*k^2+(4*n-5)*k+2*n^2-3*n+2+(2+(-1)^k)*((1-(k+n-1)*(-1)^i)))/4.
a(n) = (2*j^2+(4*i-5)*j+2*i^2-3*i+2+(2+(-1)^j)*((1-(t+1)*(-1)^i)))/4, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((sqrt(8*n-7) - 1)/2).

A216248 T(n,k)=((n+k)^2-4*k+3-(-1)^k-(n+k-2)*(-1)^(n+k))/2-1, if k=1 and (n mod 2)=1; T(n,k)=((n+k)^2-4*k+3-(-1)^k-(n+k-2)*(-1)^(n+k))/2, else. Table T(n,k) read by antidiagonals; n, k > 0.

Original entry on oeis.org

1, 2, 5, 3, 4, 6, 7, 10, 11, 14, 8, 9, 12, 13, 15, 16, 19, 20, 23, 24, 27, 17, 18, 21, 22, 25, 26, 28, 29, 32, 33, 36, 37, 40, 41, 44, 30, 31, 34, 35, 38, 39, 42, 43, 45, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 47, 48, 51, 52, 55, 56, 59, 60, 63, 64, 66, 67
Offset: 1

Views

Author

Boris Putievskiy, Mar 14 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.
Enumeration table T(n,k). Let m be natural number. The order of the list:
T(1,1)=1;
T(1,2), T(1,3), T(2,2), T(2,1), T(3,1);
. . .
T(1,2*m), T(1,2*m+1), T(2,2*m), T(2,2*m-1), T(3,2*m-2), ... T(2*m-1,2), T(2*m-1,3), T(2*m,2), T(2*m,1), T(2*m+1,1);
. . .
Movement along two adjacent antidiagonals - step to the east, step to the southwest, step to the west, step to the southwest and so on. The length of each step is 1.

Examples

			The start of the sequence as table:
1....2...3...7...8..16..17...
5....4..10...9..19..18..32...
6...11..12..20..21..33..34...
14..13..23..22..36..35..53...
15..24..25..37..38..54..55...
27..26..40..39..57..56..78...
28..41..42..58..59..79..80...
. . .
The start of the sequence as triangular array read by rows:
1;
2,5;
3,4,6;
7,10,11,14;
8,9,12,13,15;
16,19,20,23,24,27;
17,18,21,22,25,26,28;
. . .
The start of the sequence as array read by rows, the length of row number r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of triangle array, located above.
1;
2,5,3,4,6;
7,10,11,14,8,9,12,13,15;
16,19,20,23,24,27,17,18,21,22,25,26,28;
. . .
Row number r contains permutation of the 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+4, 2*r*r-5*r+7, ... 2*r*r-r-2, 2*r*r-r.
		

Crossrefs

Cf. A213205, A213171, A213197, A210521; table T(n,k) contains: in rows A033816, A130883, A100037, A100038, A100039; in columns A000384, A071355, A014106, A091823, A130861.

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3-(-1)**j-(t)*(-1)**t)/2
    if j==1 and (i%2)==1:
       result=result-1

Formula

As table
T(n,k)=((n+k)^2-4*k+3-(-1)^k-(n+k-2)*(-1)^(n+k))/2-1, if k=1 and (n mod 2)=1;
T(n,k)=((n+k)^2-4*k+3-(-1)^k-(n+k-2)*(-1)^(n+k))/2, else.
As linear sequence
a(n)=((t+2)^2-4*j+3-(-1)^j-(t)*(-1)^t)/2 -1, if j=1 and (i mod 2)=1;
a(n)=((t+2)^2-4*j+3-(-1)^j-(t)*(-1)^t)/2, else; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A216249 T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n+(-1)^k-(n+k-4)*(-1)^(n+k))/2-2, if k=1 and (n mod 2)=1; T(n,k)=((n+k)^2-4*k+3-2*(-1)^n+(-1)^k-(n+k-4)*(-1)^(n+k))/2, else. Table T(n,k) read by antidiagonals; n , k > 0.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Mar 14 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.
Enumeration table T(n,k). Let m be natural number. The order of the list:
T(1,1)=1;
T(2,1), T(1,2), T(1,3), T(2,2), T(3,1);
. . .
T(2,2*m-1), T(1,2*m), T(1,2*m+1), T(2,2*m), T(2*m-3,4), ... T(2*m,1), T(2*m-1,2), T(2*m-1,3), T(2*m,2), T(2*m+1,1);
. . .
Movement along two adjacent antidiagonals - step to the northeast, step to the east, step to the southwest, 3 steps to the west, 2 steps to the south and so on.
The length of each step is 1.

Examples

			The start of the sequence as table:
   1   3  4    8   9  17  18...
   2   5  7   10  16  19  29...
   6  12  13  21  22  34  35...
  11  14  20  23  33  36  50...
  15  25  26  38  39  55  56...
  24  27  37  40  54  57  75...
  28  42  43  59  60  80  81...
  ...
The start of the sequence as triangular array read by rows:
   1;
   3,  2;
   4,  5,  6;
   8,  7, 12, 11;
   9, 10, 13, 14, 15;
  17, 16, 21, 20, 25, 24;
  18, 19, 22, 23, 26, 27, 28;
  ...
As an array read by rows, where the length of row number r is 4*r-3:
First 2*r-2 numbers are from the row number 2*r-2 of triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of triangle array, located above.
  1;
  3,   2,   4,   5,   6;
  8,   7,  12,  11,   9,  10,  13,  14,  15;
  17, 16,  21,  20,  25,  24,  18,  19,  22,  23,  26,  27,  28;
  ...
Row number r contains permutation of the 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+5, 2*r*r-5*r+4, ...2*r*r-r-1, 2*r*r-r.
		

Crossrefs

Cf. A213205, A213171, A213197, A210521; table T(n,k) contains: in rows A100037, A033816, A130883, A100039, A100038; in columns A000384, A071355, A091823, A014106.

Programs

  • Mathematica
    T[n_, k_] := ((n+k)^2 - 4k + 3 - 2(-1)^n + (-1)^k - (n+k-4)(-1)^(n+k))/2 - 2Boole[k == 1 && OddQ[n]];
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 20 2019 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3+(-1)**j-2*(-1)**i-(t-2)*(-1)**t)/2
    if j==1 and (i%2)==1:
       result=result-2

Formula

As a table:
T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n+(-1)^k-(n+k-4)*(-1)^(n+k))/2-2, if k=1 and (n mod 2)=1;
T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n+(-1)^k-(n+k-4)*(-1)^(n+k))/2, else.
As a linear sequence:
a(n) = ((t+2)^2-4*j+3-2*(-1)^i+(-1)^j-(t-2)*(-1)^t)/2-2, if j=1 and (i mod 2)=1;
a(n) = ((t+2)^2-4*j+3-2*(-1)^i+(-1)^j-(t-2)*(-1)^t)/2, else; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A216250 T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1; T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else. Table T(n,k) read by antidiagonals; n, k > 0.

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 7, 8, 11, 12, 10, 9, 14, 13, 15, 16, 17, 20, 21, 24, 25, 19, 18, 23, 22, 27, 26, 28, 29, 30, 33, 34, 37, 38, 41, 42, 32, 31, 36, 35, 40, 39, 44, 43, 45, 46, 47, 50, 51, 54, 55, 58, 59, 62, 63, 49, 48, 53, 52, 57, 56, 61, 60, 65, 64, 66, 67
Offset: 1

Views

Author

Boris Putievskiy, Mar 14 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.
Enumeration table T(n,k). Let m be natural number. The order of the list:
T(1,1)=1;
T(1,2), T(2,1), T(2,2), T(1,3), T(3,1);
. . .
T(1,2*m), T(2,2*m-1), T(2,2*m), T(1,2*m+1), T(3,2*m-2), ... T(2*m-1,2), T(2*m,1), T(2*m,2), T(2*m-1,3), T(2*m+1,1);
. . .
Movement along two adjacent antidiagonals - step to the southwest, step east, step to the northeast, 3 steps to the west, 2 steps to the south and so on. The length of each step is 1.

Examples

			The start of the sequence as table:
  1....2...5...7..10..16..19...
  3....4...8...9..17..18..30...
  6...11..14..20..23..33..36...
  12..13..21..22..34..35..51...
  15..24..27..37..40..54..57...
  25..26..38..39..55..56..76...
  28..41..44..58..61..79..82...
  . . .
The start of the sequence as triangular array read by rows:
  1;
  2,3;
  5,4,6;
  7,8,11,12;
  10,9,14,13,15;
  16,17,20,21,24,25;
  19,18,23,22,27,26,28;
  . . .
The start of the sequence as array read by rows, with length of row r: 4*r-3:
First 2*r-2 numbers are from the row number 2*r-2 of above triangle array.
Last  2*r-1 numbers are from the row number 2*r-1 of above triangle array.
  1;
  2,3,5,4,6;
  7,8,11,12,10,9,14,13,15;
  16,17,20,21,24,25,19,18,23,22,27,26,28;
  . . .
Row number r contains permutation of the 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r: 2*r*r-5*r+4, 2*r*r-5*r+5, ...2*r*r-r-2, 2*r*r-r.
		

Crossrefs

Cf. A213205, A213171, A213197, A210521; table T(n,k) contains: in rows A130883, A033816, A100037, A100038, A100039; in columns A000384, A014106, A071355, A091823, A130861.

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3-(-1)**j-2*(-1)**i-(t-2)*(-1)**t)/2
    if j==1 and (i%2)==1:
       result=result-3

Formula

As table
T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1;
T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else.
As linear sequence
a(n) = ((t+2)^2-4*j+3-2*(-1)^i-(-1)^j-(t-2)*(-1)^t)/2-3, if j=1 and (i mod 2)=1;
a(n) = ((t+2)^2-4*j+3-2*(-1)^i-(-1)^j-(t-2)*(-1)^t)/2, else; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).
Showing 1-4 of 4 results.