OFFSET
0,2
COMMENTS
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), ...
LINKS
Eric Weisstein's World of Mathematics, Pairing Function
FORMULA
EXAMPLE
The top left 0 .. 12 x 0 .. 12 corner of the array:
0, 2, 5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90
2, 1, 13, 8, 26, 19, 43, 34, 64, 53, 89, 76, 118
5, 13, 3, 7, 42, 52, 25, 33, 88, 102, 63, 75, 150
9, 8, 7, 6, 62, 51, 41, 32, 116, 101, 87, 74, 186
14, 26, 42, 62, 10, 16, 23, 31, 148, 166, 185, 205, 86
20, 19, 52, 51, 16, 15, 39, 30, 184, 165, 225, 204, 114
27, 43, 25, 41, 23, 39, 21, 29, 224, 246, 183, 203, 146
35, 34, 33, 32, 31, 30, 29, 28, 268, 245, 223, 202, 182
44, 64, 88, 116, 148, 184, 224, 268, 36, 46, 57, 69, 82
54, 53, 102, 101, 166, 165, 246, 245, 46, 45, 81, 68, 110
65, 89, 63, 87, 185, 225, 183, 223, 57, 81, 55, 67, 142
77, 76, 75, 74, 205, 204, 203, 202, 69, 68, 67, 66, 178
90, 118, 150, 186, 86, 114, 146, 182, 82, 110, 142, 178, 78
MATHEMATICA
T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], Min[n, k]]; Table[A[k, n - k], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 21 2017 *)
PROG
(Scheme)
(define (A286150bi row col) (let ((a (A003987bi row col)) (b (min col row))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Where A003987bi implements bitwise-xor (A003987).
(Python)
def T(a, b): return ((a + b)**2 + 3*a + b)//2
def A(n, k): return T(n^k, min(n, k))
for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, May 21 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, May 03 2017
STATUS
approved