%I #10 Feb 25 2020 18:34:57
%S 0,1,2,4,5,3,10,11,6,7,20,21,12,13,8,35,36,22,23,14,9,56,57,37,38,24,
%T 15,16,84,85,58,59,39,25,26,17,120,121,86,87,60,40,41,27,18,165,166,
%U 122,123,88,61,62,42,28,19,220,221,167,168,124,89,90,63,43,29,30
%N Permutation of N = {0, 1, 2, ...} induced by the enumeration of N X N in A332662.
%C Motivated by the question how a sequence of regular integer triangles can be stored in linear memory (see A332662).
%e a(n) can be seen as the triangle read by rows:
%e [0] 0;
%e [1] 1, 2;
%e [2] 4, 5, 3;
%e [3] 10, 11, 6, 7;
%e [4] 20, 21, 12, 13, 8;
%e [5] 35, 36, 22, 23, 14, 9;
%e [6] 56, 57, 37, 38, 24, 15, 16;
%e [7] 84, 85, 58, 59, 39, 25, 26, 17;
%e ...
%e a(n) can also be seen as the rectangular array read by upwards antidiagonals (with flat rows):
%e (A) [ 0], [ 2, 3], [ 7, 8, 9], [16, 17, 18, 19], [30, 31, 32, 33, 34],...
%e (B) [ 1], [ 5, 6], [13, 14, 15], [26, 27, 28, 29], ...
%e (C) [ 4], [11, 12], [23, 24, 25], ...
%e (D) [10], [21, 22], ...
%e (E) [20], ...
%e ...
%p F := L -> ListTools:-Flatten(L): b := n -> floor((sqrt(8*n+1)-1)/2):
%p S := (n, k) -> [seq(binomial(n+k+2,3) + binomial(k+1,2)+j, j=0..k)]:
%p A332667 := (n, k) -> F([seq(S(n-k,j), j=0..b(k))])[k+1]:
%p seq(seq(A332667(n, k), k=0..n), n=0..10);
%Y Cf. A332662, A000292 (first column), A332699 (main diagonal).
%K nonn,tabl
%O 0,3
%A _Peter Luschny_, Feb 19 2020