The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A216252 A213196 as table read layer by layer clockwise. 1
 1, 4, 5, 2, 3, 7, 10, 8, 6, 11, 9, 17, 20, 23, 14, 12, 13, 16, 26, 38, 43, 39, 21, 24, 15, 22, 25, 30, 42, 58, 63, 48, 35, 31, 27, 18, 19, 29, 34, 57, 53, 69, 76, 70, 64, 49, 36, 32, 28, 37, 33, 47, 52, 81, 75, 95, 102, 109, 88, 82, 54, 59, 44, 40, 41, 46, 62 (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. Call a "layer" a 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); . . . LINKS Boris Putievskiy, Rows n = 1..140 of triangle, flattened Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO] Eric W. Weisstein, MathWorld: Pairing functions FORMULA a(n)=(m1+m2-1)*(m1+m2-2)/2+m1, where m1=(3*i+j-1-(-1)^i+(i+j-2)*(-1)^(i+j))/4, m2=((1+(-1)^i)*((1+(-1)^j)*2*int((j+2)/4)-(-1+(-1)^j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)^i)*((1+(-1)^j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)^j)*(1+2*int(j/4))))/4, i=min(t; n-(t-1)^2), j=min(t; t^2-n+1), t=floor(sqrt(n-1))+1. EXAMPLE The start of the sequence as table: 1....4...3..11..13... 2....5...7...9..16... 6....8..10..17..26... 12..14..23..20..38... 15..24..21..39..43... . . . The start of the sequence as triangular array read by rows: 1; 4,5,2; 3,7,10,8,6; 11,9,17,20,23,14,12; 13,16,26,38,43,39,21,24,15; . . . Row number r contains 2*r-1 numbers. PROG (Python) t=int((math.sqrt(n-1)))+1 i=min(t, n-(t-1)**2) j=min(t, t**2-n+1) m1=(3*i+j-1-(-1)**i+(i+j-2)*(-1)**(i+j))/4 m2=((1+(-1)**i)*((1+(-1)**j)*2*int((j+2)/4)-(-1+(-1)**j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)**i)*((1+(-1)**j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)**j)*(1+2*int(j/4))))/4 m=(m1+m2-1)*(m1+m2-2)/2+m1 CROSSREFS Cf. A213196, A211377, A214928, A060734, A060736. Sequence in context: A057301 A213171 A261098 * A328622 A328623 A225901 Adjacent sequences:  A216249 A216250 A216251 * A216253 A216254 A216255 KEYWORD nonn,tabl AUTHOR Boris Putievskiy, Mar 15 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified January 22 04:27 EST 2020. Contains 331133 sequences. (Running on oeis4.)