%I #19 Feb 16 2025 08:33:44
%S 0,4,2,12,1,5,24,18,13,9,40,17,3,8,14,60,50,11,7,26,20,84,49,61,6,42,
%T 19,27,112,98,85,73,62,52,43,35,144,97,59,72,10,51,25,34,44,180,162,
%U 83,71,22,16,41,33,64,54,220,161,181,70,38,15,23,32,88,53,65,264,242,221,201,58,48,39,31,116,102,89,77,312,241,179,200,222,47,21,30,148,101,63,76,90
%N Square array read by antidiagonals: A(n,k) = T(n XOR k, k), where T(n,k) is sequence A001477 considered as a two-dimensional table, and XOR is bitwise-xor (A003987).
%C The array is read by descending antidiagonals as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...
%H Antti Karttunen, <a href="/A286145/b286145.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H MathWorld, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A(n,k) = T(A003987(n,k), k), where T(n,k) is sequence A001477 considered as a two-dimensional table, that is, as a pairing function from [0, 1, 2, 3, ...] x [0, 1, 2, 3, ...] to [0, 1, 2, 3, ...].
%e The top left 0 .. 12 x 0 .. 12 corner of the array:
%e 0, 4, 12, 24, 40, 60, 84, 112, 144, 180, 220, 264, 312
%e 2, 1, 18, 17, 50, 49, 98, 97, 162, 161, 242, 241, 338
%e 5, 13, 3, 11, 61, 85, 59, 83, 181, 221, 179, 219, 365
%e 9, 8, 7, 6, 73, 72, 71, 70, 201, 200, 199, 198, 393
%e 14, 26, 42, 62, 10, 22, 38, 58, 222, 266, 314, 366, 218
%e 20, 19, 52, 51, 16, 15, 48, 47, 244, 243, 340, 339, 240
%e 27, 43, 25, 41, 23, 39, 21, 37, 267, 315, 265, 313, 263
%e 35, 34, 33, 32, 31, 30, 29, 28, 291, 290, 289, 288, 287
%e 44, 64, 88, 116, 148, 184, 224, 268, 36, 56, 80, 108, 140
%e 54, 53, 102, 101, 166, 165, 246, 245, 46, 45, 94, 93, 158
%e 65, 89, 63, 87, 185, 225, 183, 223, 57, 81, 55, 79, 177
%e 77, 76, 75, 74, 205, 204, 203, 202, 69, 68, 67, 66, 197
%e 90, 118, 150, 186, 86, 114, 146, 182, 82, 110, 142, 178, 78
%t T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], k]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, May 21 2017 *)
%o (Scheme)
%o (define (A286145 n) (A286145bi (A002262 n) (A025581 n)))
%o (define (A286145bi row col) (let ((a (A003987bi row col)) (b col)) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Where A003987bi implements bitwise-xor (A003987).
%o (Python)
%o def T(a, b): return ((a + b)**2 + 3*a + b)//2
%o def A(n, k): return T(n^k, k)
%o for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # _Indranil Ghosh_, May 21 2017
%Y Transpose: A286147.
%Y Cf. A046092 (row 0), A000096 (column 0), A000217 (main diagonal).
%Y Cf. A003987, A001477, A286108, A286109, A286150, A286151.
%K nonn,tabl,changed
%O 0,2
%A _Antti Karttunen_, May 03 2017