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.

A221215 T(n,k)= ((n+k)^2-2*(n+k)+4-(n+3*k-2)*(-1)^(n+k))/2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 22 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,3), T(2,2), T(3,1);
T(2,1), T(1,2);
. . .
T(1,2*m+1), T(2,2*m), T(3,2*m-1), ... T(2*m+1,1);
T(2*m,1), T(2*m-1,2), T(2*m-2,3),...T(1,2*m);
. . .
First row contains elements antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read downwards.
second row contains elements antidiagonal {T(1,2*m), ... T(2*m,1)}, read upwards.
The same as A211394, except for reversed order in even diagonals. - M. F. Hasler, Feb 26 2013

Examples

			The start of the sequence as table:
1....6...2..15...7..28..16...
5....3..14...8..27..17..44...
4...13...9..26..18..43..31...
12..10..25..19..42..32..63...
11..24..20..41..33..62..50...
23..21..40..34..61..51..86...
22..39..35..60..52..85..73...
. . .
The start of the sequence as triangle array read by rows:
1;
6,5;
2,3,4;
15,14,13,12;
7,8,9,10,11;
28,27,26,25,24,23;
16,17,18,19,20,21,22;
. . .
Row number r contains r consecutive numbers.
If r is odd,  row is increasing.
If r is even, row is decreasing.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := ((n+k)^2 - 2(n+k) + 4 - (n+3k-2)(-1)^(n+k))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jan 05 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-2*(t+2)+4-(i+3*j-2)*(-1)**t)/2

Formula

As table
T(n,k)= ((n+k)^2-2*(n+k)+4-(n+3*k-2)*(-1)^(n+k))/2.
As linear sequence
a(n) = (A003057(n)^2-2*A003057(n)+4-(A002260(n)+3*A004736(n)-2)*(-1)^A003056(n))/2; a(n) = ((t+2)^2-2*(t+2)+4-(i+3*j-2)*(-1)^t)/2,
where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A221216 T(n,k) = ((n+k)^2-2*(n+k)+4-(3*n+k-2)*(-1)^(n+k))/2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 22 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(3,1), T(2,2), T(1,3);
T(1,2), T(2,1);
. . .
T(2*m+1,1), T(2*m,2), T(2*m-1,3),...T(2,2*m), T(1,2*m+1);
T(1,2*m), T(2,2*m-1), T(3,2*m-2),...T(2*m-1,2),T(2*m,1);
. . .
First row contains antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read upwards.
Second row contains antidiagonal {T(1,2*m), ... T(2*m,1)}, read downwards.

Examples

			The start of the sequence as table:
  1....5...4..12..11..23..22...
  6....3..13..10..24..21..39...
  2...14...9..25..20..40..35...
  15...8..26..19..41..34..60...
  7...27..18..42..33..61..52...
  28..17..43..32..62..51..85...
  16..44..31..63..50..86..73...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  5,6;
  4,3,2;
  12,13,14,15;
  11,10,9,8,7;
  23,24,25,26,27,28;
  22,21,20,19,18,17,16;
  . . .
Row number r consecutive contains r numbers.
If r is odd,  row is decreasing.
If r is even, row is increasing.
		

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=((t+2)**2-2*(t+2)+4-(3*i+j-2)*(-1)**t)/2

Formula

As table
T(n,k) = ((n+k)^2-2*(n+k)+4-(3*n+k-2)*(-1)^(n+k))/2.
As linear sequence
a(n) = (A003057(n)^2-2*A003057(n)+4-(3*A002260(n)+A004736(n)-2)*(-1)^A003056(n))/2; a(n) = ((t+2)^2-2*(t+2)+4-(i+3*j-2)*(-1)^t)/2,
where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A221217 T(n,k) = ((n+k)^2-2*n+3-(n+k-1)*(1+2*(-1)^(n+k)))/2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 22 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(3,1), T(2,2), T(1,3);
T(2,1), T(1,2);
. . .
T(2*m+1,1), T(2*m,2), T(2*m-1,3),...T(1,2*m+1);
T(2*m,1), T(2*m-1,2), T(2*m-2,3),...T(1,2*m);
. . .
First row contains antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read upwards.
Second row contains antidiagonal {T(1,2*m), ... T(2*m,1)}, read upwards.

Examples

			The start of the sequence as table:
  1....6...4..15..11..28..22...
  5....3..14..10..27..21..44...
  2...13...9..26..20..43..35...
  12...8..25..19..42..34..63...
  7...24..18..41..33..62..52...
  23..17..40..32..61..51..86...
  16..39..31..60..50..85..73...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  6,5;
  4,3,2;
  15,14,13,12;
  11,10,9,8,7;
  28,27,26,25,24,23;
  22,21,20,19,18,17,16;
  . . .
Row number r consecutive contains r numbers in decreasing order.
		

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=((t+2)**2-2*i+3-(t+1)*(1+2*(-1)**t))/2

Formula

As table
T(n,k) = ((n+k)^2-2*n+3-(n+k-1)*(1+2*(-1)^(n+k)))/2.
As linear sequence
a(n) = (A003057(n)^2-2*A002260(n)+3-A002024(n)*(1+2*(-1)^A003056(n)))/2;
a(n) = ((t+2)^2-2*i+3-(t+1)*(1+2*(-1)**t))/2, 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-3 of 3 results.