%I #14 Dec 07 2019 12:18:29
%S 0,2,2,5,4,5,9,9,9,9,14,13,12,13,14,20,20,18,18,20,20,27,26,27,24,27,
%T 26,27,35,35,35,35,35,35,35,35,44,43,42,43,40,43,42,43,44,54,54,52,52,
%U 50,50,52,52,54,54,65,64,65,62,61,60,61,62,65,64,65,77,77,77,77,73,73,73,73,77,77,77,77,90,89,88,89,90,85,84,85,90,89,88,89,90
%N Square array read by antidiagonals: A(n,k) = T(n OR k, n AND k), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and OR is bitwise-or (A003986).
%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="/A286099/b286099.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H MathWorld, <a href="http://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A(n,k) = T(A003986(n,k), A004198(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, 2, 5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90
%e 2, 4, 9, 13, 20, 26, 35, 43, 54, 64, 77, 89, 104
%e 5, 9, 12, 18, 27, 35, 42, 52, 65, 77, 88, 102, 119
%e 9, 13, 18, 24, 35, 43, 52, 62, 77, 89, 102, 116, 135
%e 14, 20, 27, 35, 40, 50, 61, 73, 90, 104, 119, 135, 148
%e 20, 26, 35, 43, 50, 60, 73, 85, 104, 118, 135, 151, 166
%e 27, 35, 42, 52, 61, 73, 84, 98, 119, 135, 150, 168, 185
%e 35, 43, 52, 62, 73, 85, 98, 112, 135, 151, 168, 186, 205
%e 44, 54, 65, 77, 90, 104, 119, 135, 144, 162, 181, 201, 222
%e 54, 64, 77, 89, 104, 118, 135, 151, 162, 180, 201, 221, 244
%e 65, 77, 88, 102, 119, 135, 150, 168, 181, 201, 220, 242, 267
%e 77, 89, 102, 116, 135, 151, 168, 186, 201, 221, 242, 264, 291
%e 90, 104, 119, 135, 148, 166, 185, 205, 222, 244, 267, 291, 312
%t T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitOr[n, k],BitAnd[n, k]]; Table[A[n - k, k], {n, 0, 20}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, May 21 2017 *)
%o (Scheme)
%o (define (A286099 n) (A286099bi (A002262 n) (A025581 n)))
%o (define (A286099bi row col) (let ((a (A003986bi row col)) (b (A004198bi row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003986bi and A004198bi implement bitwise-OR (A003986) 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(n|k, n&k)
%o for n in range(0, 21): print [A(k, n - k) for k in range(0, n + 1)] # _Indranil Ghosh_, May 21 2017
%Y Cf. A000096 (row 0 & column 0), A162761 (seems to be row 1 & column 1), A046092 (main diagonal).
%Y Cf. A003056, A003986, A004198.
%Y Cf. also arrays A286098, A286101, A286102, A286109.
%K nonn,tabl
%O 0,2
%A _Antti Karttunen_, May 03 2017
|