%I #55 Jan 21 2022 13:48:02
%S 0,1,2,4,3,8,5,6,9,10,16,7,12,11,32,17,18,13,14,33,34,20,19,24,15,36,
%T 35,40,21,22,25,26,37,38,41,42,64,23,28,27,48,39,44,43,128,65,66,29,
%U 30,49,50,45,46,129,130,68,67,72,31,52,51,56,47,132,131,136,69,70,73,74
%N Array read by downward antidiagonals: T(i,j) = bits of binary expansion of i interleaved with that of j.
%C Inverse of sequence A054239 considered as a permutation of the nonnegative integers.
%C Permutation of nonnegative integers. Can be used as natural alternate number casting for pairs/tables (vs. usual diagonalization).
%C This array is a Z-order curve in an N x N grid. - _Max Barrentine_, Sep 24 2015
%C Each row n of this array is the lexicographically earliest sequence such that no term occurs in a previous row, no three terms form an arithmetic progression, and the k-th term in the n-th row is equal to the k-th term in row 0 plus some constant (specifically, T(n,k) = T(0,k) + A062880(n)). - _Max Barrentine_, Jul 20 2016
%H Robert Israel, <a href="/A054238/b054238.txt">Table of n, a(n) for n = 0..10000</a>
%H G. M. Morton, <a href="https://dominoweb.draco.res.ibm.com/0dabf9473b9c86d48525779800566a39.html">A Computer Oriented Geodetic Data Base; and a New Technique in File Sequencing</a>, IBM, 1966.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Z-order_curve">Z-order Curve</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F T(n,k) = A000695(k) + 2*A000695(n). - _Philippe Deléham_, Oct 18 2011
%F From _Robert Israel_, Jul 21 2016: (Start)
%F G.f. of array: g(x,y) = (1/(1-x)*(1-y)) * Sum_{i>=0}
%F (2^(2*i+1)*x^(2^i)/(1+x^(2^i)) + 2^(2*i)*y^(2^i)/(1+y^(2^i))).
%F T(2*n+i,2*k+j) = 4*T(n,k) + 2*i+j for i,j in {0,1}. (End)
%e From _Philippe Deléham_, Oct 18 2011: (Start)
%e The array starts in row n=0 with columns k >= 0 as follows:
%e 0 1 4 5 16 17 20 21 ...
%e 2 3 6 7 18 19 22 23 ...
%e 8 9 12 13 24 25 28 29 ...
%e 10 11 14 15 26 27 30 31 ...
%e 32 33 36 37 48 49 52 53 ...
%e 34 35 38 39 50 51 54 55 ...
%e 40 41 44 45 56 57 60 61 ...
%e 42 43 46 47 58 59 62 63 ...
%e (End)
%e T(6,5)=57 because 1.1.0. (6) merged with .1.0.1 (5) is 111001 (57). [Corrected by _Georg Fischer_, Jan 21 2022]
%p N:= 4: # to get the first 2^(2N+1)+2^N terms
%p G:= 1/(1-y)/(1-x)*(add(2^(2*i+1)*x^(2^i)/(1+x^(2^i)),i=0..N) + add(2^(2*i)*y^(2^i)/(1+y^(2^i)),i=0..N)):
%p S:= mtaylor(G,[x=0,y=0],2^(N+1)):
%p seq(seq(coeff(coeff(S,x,i),y,m-i),i=0..m),m=0..2^(N+1)-1); # _Robert Israel_, Jul 21 2016
%t Table[Total@ Map[FromDigits[#, 2] &, Insert[#, 0, {-1, -1}] &@ Map[Riffle[IntegerDigits[#, 2], 0, 2] &, {n - k, k}]], {n, 0, 11}, {k, 0, n}] // Flatten (* _Michael De Vlieger_, Jul 21 2016 *)
%Y Cf. A000695 (row n=0), A062880 (column k=0), A001196 (main diagonal).
%Y Cf. A059905, A059906, A346453 (by upwards antidiagonals).
%Y See also A163357 and A163334 for other fractal curves in N x N grids.
%K easy,nonn,base,tabl
%O 0,3
%A _Marc LeBrun_, Feb 07 2000