login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1
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 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
1,2
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.
LINKS
Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
Eric Weisstein's World of Mathematics, Pairing functions
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).
EXAMPLE
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.
PROG
(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
CROSSREFS
table T(n,k) contains: in rows A084849, A096376, A014105, A014107, A168244, A033537, A100040, A100041;
main diagonal and parallel diagonals are A058331, A001844, A005893,A046092, A093328, A142463, A090288, A059993, A051890, A001105, A097080, A056220, A137882, A054000.
Sequence in context: A099038 A064206 A087197 * A229073 A019818 A187146
KEYWORD
nonn,tabl
AUTHOR
Boris Putievskiy, Feb 22 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)