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.

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.

This page as a plain text file.
%I A221216 #29 Feb 16 2025 08:33:19
%S A221216 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,
%T A221216 17,16,38,39,40,41,42,43,44,45,37,36,35,34,33,32,31,30,29,57,58,59,60,
%U A221216 61,62,63,64,65,66,56,55,54,53,52,51,50,49,48,47,46,80
%N 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.
%C A221216 Permutation of the natural numbers.
%C A221216 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.
%C A221216 Enumeration table T(n,k). Let m be natural number. The order of the list:
%C A221216   T(1,1)=1;
%C A221216   T(3,1), T(2,2), T(1,3);
%C A221216   T(1,2), T(2,1);
%C A221216   . . .
%C A221216   T(2*m+1,1), T(2*m,2), T(2*m-1,3),...T(2,2*m), T(1,2*m+1);
%C A221216   T(1,2*m), T(2,2*m-1), T(3,2*m-2),...T(2*m-1,2),T(2*m,1);
%C A221216   . . .
%C A221216 First row  contains antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read upwards.
%C A221216 Second row contains antidiagonal {T(1,2*m), ... T(2*m,1)},  read downwards.
%H A221216 Boris Putievskiy, <a href="/A221216/b221216.txt">Rows n = 1..140 of triangle, flattened</a>
%H A221216 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [of] Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012.
%H A221216 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a>
%H A221216 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A221216 As table
%F A221216 T(n,k) = ((n+k)^2-2*(n+k)+4-(3*n+k-2)*(-1)^(n+k))/2.
%F A221216 As linear sequence
%F A221216 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,
%F A221216   where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).
%e A221216 The start of the sequence as table:
%e A221216   1....5...4..12..11..23..22...
%e A221216   6....3..13..10..24..21..39...
%e A221216   2...14...9..25..20..40..35...
%e A221216   15...8..26..19..41..34..60...
%e A221216   7...27..18..42..33..61..52...
%e A221216   28..17..43..32..62..51..85...
%e A221216   16..44..31..63..50..86..73...
%e A221216   . . .
%e A221216 The start of the sequence as triangle array read by rows:
%e A221216   1;
%e A221216   5,6;
%e A221216   4,3,2;
%e A221216   12,13,14,15;
%e A221216   11,10,9,8,7;
%e A221216   23,24,25,26,27,28;
%e A221216   22,21,20,19,18,17,16;
%e A221216   . . .
%e A221216 Row number r consecutive contains r numbers.
%e A221216 If r is odd,  row is decreasing.
%e A221216 If r is even, row is increasing.
%o A221216 (Python)
%o A221216 t=int((math.sqrt(8*n-7) - 1)/ 2)
%o A221216 i=n-t*(t+1)/2
%o A221216 j=(t*t+3*t+4)/2-n
%o A221216 result=((t+2)**2-2*(t+2)+4-(3*i+j-2)*(-1)**t)/2
%Y A221216 Cf. A211394, A221215, A002260, A004736, A003057;
%Y A221216 table T(n,k) contains: in rows A084849, A096376, A014105, A014107, A168244, A033537, A100040, A100041;
%Y A221216 in columns A130883, A000384, A014106, A033816, A100037, A091823, A071355, A100038, A100039,A130861;
%Y A221216 main diagonal and parallel diagonals are  A058331, A001844, A005893,A046092, A093328, A142463, A090288, A059993, A051890, A001105, A097080, A056220, A137882, A054000.
%K A221216 nonn,tabl
%O A221216 1,2
%A A221216 _Boris Putievskiy_, Feb 22 2013