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.

A056023 The positive integers written as a triangle, where row n is written from right to left if n is odd and otherwise from left to right.

This page as a plain text file.
%I A056023 #61 Feb 16 2025 08:32:43
%S A056023 1,2,3,6,5,4,7,8,9,10,15,14,13,12,11,16,17,18,19,20,21,28,27,26,25,24,
%T A056023 23,22,29,30,31,32,33,34,35,36,45,44,43,42,41,40,39,38,37,46,47,48,49,
%U A056023 50,51,52,53,54,55,66,65,64,63,62,61,60,59,58,57,56
%N A056023 The positive integers written as a triangle, where row n is written from right to left if n is odd and otherwise from left to right.
%C A056023 A triangle such that (1) every positive integer occurs exactly once; (2) row n consists of n consecutive numbers; (3) odd-numbered rows are decreasing; (4) even-numbered rows are increasing; and (5) column 1 is increasing.
%C A056023 Self-inverse permutation of the natural numbers.
%C A056023 T(2*n-1,1) = A000217(2*n-1) = T(2*n,1) - 1; T(2*n,4*n) = A000217(2*n) = T(2*n+1,4*n+1) - 1. - _Reinhard Zumkeller_, Apr 25 2004
%C A056023 Mirror image of triangle in A056011. - _Philippe Deléham_, Apr 04 2009
%C A056023 From _Clark Kimberling_, Feb 03 2011: (Start)
%C A056023 When formatted as a rectangle R, for m > 1, the numbers n-1 and n+1 are neighbors (row, column, or diagonal) of R.
%C A056023 R(n,k) = n + (k+n-2)(k+n-1)/2 if n+k is odd;
%C A056023 R(n,k) = k + (n+k-2)(n+k-1)/2 if n+k is even.
%C A056023 Northwest corner:
%C A056023    1,  2,  6,  7, 15, 16, 28
%C A056023    3,  5,  8, 14, 17, 27, 30
%C A056023    4,  9, 13, 18, 26, 31, 43
%C A056023   10, 12, 19, 25, 32, 42, 49
%C A056023   11, 20, 24, 33, 41, 50, 62
%C A056023   (End)
%C A056023 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. - _Boris Putievskiy_, Dec 24 2012
%C A056023 For generalizations see A218890, A213927. - _Boris Putievskiy_, Mar 10 2013
%H A056023 Ivan Neretin, <a href="/A056023/b056023.txt">Table of n, a(n) for n = 1..5050</a>
%H A056023 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations Integer Sequences And Pairing Functions</a>, arXiv:1212.2732 [math.CO], 2012.
%H A056023 Eric Weisstein's MathWorld, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a>
%H A056023 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A056023 T(n, k) = (n^2 - (n - 2*k)*(-1)^(n mod 2))/2 + n mod 2. - _Reinhard Zumkeller_, Apr 25 2004
%F A056023 a(n) = ((i + j - 1)*(i + j - 2) + ((-1)^t + 1)*j - ((-1)^t - 1)*i)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n and t=floor((-1+sqrt(8*n-7))/2). - _Boris Putievskiy_, Dec 24 2012
%e A056023 From _Philippe Deléham_, Apr 04 2009 (Start)
%e A056023 Triangle begins:
%e A056023   1;
%e A056023   2,   3;
%e A056023   6,   5,  4;
%e A056023   7,   8,  9, 10;
%e A056023   15, 14, 13, 12, 11;
%e A056023   ...
%e A056023 (End)
%e A056023 Enumeration by boustrophedonic ("ox-plowing") diagonal method. - _Boris Putievskiy_, Dec 24 2012
%t A056023 (* As a rectangle: *)
%t A056023 r[n_, k_] := n + (k + n - 2) (k + n - 1)/2/; OddQ[n + k];
%t A056023 r[n_, k_] := k + (n + k - 2) (n + k - 1)/2/; EvenQ[n+k];
%t A056023 TableForm[Table[f[n, k], {n, 1, 10}, {k, 1, 15}]]
%t A056023 Table[r[n - k + 1, k], {n, 14}, {k, n, 1, -1}]//Flatten
%t A056023 (* _Clark Kimberling_, Feb 03 2011 *)
%t A056023 Module[{nn=15},If[OddQ[Length[#]],Reverse[#],#]&/@TakeList[Range[ (nn(nn+1))/2],Range[nn]]]//Flatten (* _Harvey P. Dale_, Feb 08 2022 *)
%Y A056023 Cf. A056011, A218890, A213927.
%K A056023 nonn,tabl,easy
%O A056023 1,2
%A A056023 _Clark Kimberling_, Aug 01 2000
%E A056023 Name edited by _Andrey Zabolotskiy_, Apr 16 2023