%I #21 Apr 28 2021 01:40:54
%S 0,1,1,3,5,3,6,6,6,6,10,12,14,12,10,15,15,19,19,15,15,21,23,21,27,21,
%T 23,21,28,28,28,28,28,28,28,28,36,38,40,38,44,38,40,38,36,45,45,49,49,
%U 53,53,49,49,45,45,55,57,55,61,63,65,63,61,55,57,55,66,66,66,66,74,74,74,74,66,66,66,66,78,80,82,80,78,88,90,88,78,80,82,80,78
%N Square array read by antidiagonals: A(n,k) = T(2*(n AND k), n XOR k), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) 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="/A286108/b286108.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A(n,k) = T(2*A004198(n,k), A003987(n,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, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78
%e 1, 5, 6, 12, 15, 23, 28, 38, 45, 57, 66, 80, 91
%e 3, 6, 14, 19, 21, 28, 40, 49, 55, 66, 82, 95, 105
%e 6, 12, 19, 27, 28, 38, 49, 61, 66, 80, 95, 111, 120
%e 10, 15, 21, 28, 44, 53, 63, 74, 78, 91, 105, 120, 144
%e 15, 23, 28, 38, 53, 65, 74, 88, 91, 107, 120, 138, 161
%e 21, 28, 40, 49, 63, 74, 90, 103, 105, 120, 140, 157, 179
%e 28, 38, 49, 61, 74, 88, 103, 119, 120, 138, 157, 177, 198
%e 36, 45, 55, 66, 78, 91, 105, 120, 152, 169, 187, 206, 226
%e 45, 57, 66, 80, 91, 107, 120, 138, 169, 189, 206, 228, 247
%e 55, 66, 82, 95, 105, 120, 140, 157, 187, 206, 230, 251, 269
%e 66, 80, 95, 111, 120, 138, 157, 177, 206, 228, 251, 275, 292
%e 78, 91, 105, 120, 144, 161, 179, 198, 226, 247, 269, 292, 324
%t T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[2*BitAnd[n, k], BitXor[n, k]]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, May 20 2017 *)
%o (Scheme)
%o (define (A286108 n) (A286108bi (A002262 n) (A025581 n)))
%o (define (A286108bi row col) (let ((a (* 2 (A004198bi row col))) (b (A003987bi row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003987bi and A004198bi implement bitwise-xor (A003987) and bitwise-and (A004198).
%o (Python)
%o def T(a, b): return ((a + b)**2 + 3*a + b)//2
%o def A(n, k): return T(2*(n&k), n^k)
%o for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # _Indranil Ghosh_, May 20 2017
%Y Cf. A000217 (row 0 & column 0), A014106 (main diagonal).
%Y Cf. A003056, A003987, A004198.
%Y Cf. also arrays A286098, A286109, A286145, A286147, A286150, A286151.
%K nonn,tabl
%O 0,4
%A _Antti Karttunen_, May 03 2017
|