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
MathWorld, 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
4, 1, 13, 8, 26, 19, 43, 34, 64, 53, 89, 76, 118
12, 18, 3, 7, 42, 52, 25, 33, 88, 102, 63, 75, 150
24, 17, 11, 6, 62, 51, 41, 32, 116, 101, 87, 74, 186
40, 50, 61, 73, 10, 16, 23, 31, 148, 166, 185, 205, 86
60, 49, 85, 72, 22, 15, 39, 30, 184, 165, 225, 204, 114
84, 98, 59, 71, 38, 48, 21, 29, 224, 246, 183, 203, 146
112, 97, 83, 70, 58, 47, 37, 28, 268, 245, 223, 202, 182
144, 162, 181, 201, 222, 244, 267, 291, 36, 46, 57, 69, 82
180, 161, 221, 200, 266, 243, 315, 290, 56, 45, 81, 68, 110
220, 242, 179, 199, 314, 340, 265, 289, 80, 94, 55, 67, 142
264, 241, 219, 198, 366, 339, 313, 288, 108, 93, 79, 66, 178
312, 338, 365, 393, 218, 240, 263, 287, 140, 158, 177, 197, 78
MATHEMATICA
T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], k]; Table[A[n - k, k], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 21 2017 *)
PROG
(Scheme)
(define (A286147bi row col) (let ((a (A003987bi row col)) (b 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, k)
for n in range(21): print([A(n - k, k) for k in range(n + 1)]) # Indranil Ghosh, May 21 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, May 03 2017
STATUS
approved