[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A286145 revision #15

A286145
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).
6
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, 19, 27, 112, 98, 85, 73, 62, 52, 43, 35, 144, 97, 59, 72, 10, 51, 25, 34, 44, 180, 162, 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
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), ...
FORMULA
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, ...].
EXAMPLE
The top left 0 .. 12 x 0 .. 12 corner of the array:
0, 4, 12, 24, 40, 60, 84, 112, 144, 180, 220, 264, 312
2, 1, 18, 17, 50, 49, 98, 97, 162, 161, 242, 241, 338
5, 13, 3, 11, 61, 85, 59, 83, 181, 221, 179, 219, 365
9, 8, 7, 6, 73, 72, 71, 70, 201, 200, 199, 198, 393
14, 26, 42, 62, 10, 22, 38, 58, 222, 266, 314, 366, 218
20, 19, 52, 51, 16, 15, 48, 47, 244, 243, 340, 339, 240
27, 43, 25, 41, 23, 39, 21, 37, 267, 315, 265, 313, 263
35, 34, 33, 32, 31, 30, 29, 28, 291, 290, 289, 288, 287
44, 64, 88, 116, 148, 184, 224, 268, 36, 56, 80, 108, 140
54, 53, 102, 101, 166, 165, 246, 245, 46, 45, 94, 93, 158
65, 89, 63, 87, 185, 225, 183, 223, 57, 81, 55, 79, 177
77, 76, 75, 74, 205, 204, 203, 202, 69, 68, 67, 66, 197
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], k]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 21 2017 *)
PROG
(Scheme)
(define (A286145 n) (A286145bi (A002262 n) (A025581 n)))
(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).
(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(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, May 21 2017
CROSSREFS
Transpose: A286147.
Cf. A046092 (row 0), A000096 (column 0), A000217 (main diagonal).
Sequence in context: A142706 A361216 A092952 * A010318 A188134 A226725
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, May 03 2017
STATUS
editing