cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A286145 #19 Feb 16 2025 08:33:44
%S A286145 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,
%T A286145 19,27,112,98,85,73,62,52,43,35,144,97,59,72,10,51,25,34,44,180,162,
%U A286145 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
%N 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).
%C A286145 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 A286145 Antti Karttunen, <a href="/A286145/b286145.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H A286145 MathWorld, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286145 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, ...].
%e A286145 The top left 0 .. 12 x 0 .. 12 corner of the array:
%e A286145    0,   4,  12,  24,  40,  60,  84, 112, 144, 180, 220, 264, 312
%e A286145    2,   1,  18,  17,  50,  49,  98,  97, 162, 161, 242, 241, 338
%e A286145    5,  13,   3,  11,  61,  85,  59,  83, 181, 221, 179, 219, 365
%e A286145    9,   8,   7,   6,  73,  72,  71,  70, 201, 200, 199, 198, 393
%e A286145   14,  26,  42,  62,  10,  22,  38,  58, 222, 266, 314, 366, 218
%e A286145   20,  19,  52,  51,  16,  15,  48,  47, 244, 243, 340, 339, 240
%e A286145   27,  43,  25,  41,  23,  39,  21,  37, 267, 315, 265, 313, 263
%e A286145   35,  34,  33,  32,  31,  30,  29,  28, 291, 290, 289, 288, 287
%e A286145   44,  64,  88, 116, 148, 184, 224, 268,  36,  56,  80, 108, 140
%e A286145   54,  53, 102, 101, 166, 165, 246, 245,  46,  45,  94,  93, 158
%e A286145   65,  89,  63,  87, 185, 225, 183, 223,  57,  81,  55,  79, 177
%e A286145   77,  76,  75,  74, 205, 204, 203, 202,  69,  68,  67,  66, 197
%e A286145   90, 118, 150, 186,  86, 114, 146, 182,  82, 110, 142, 178,  78
%t A286145 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 *)
%o A286145 (Scheme)
%o A286145 (define (A286145 n) (A286145bi (A002262 n) (A025581 n)))
%o A286145 (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).
%o A286145 (Python)
%o A286145 def T(a, b): return ((a + b)**2 + 3*a + b)//2
%o A286145 def A(n, k): return T(n^k, k)
%o A286145 for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # _Indranil Ghosh_, May 21 2017
%Y A286145 Transpose: A286147.
%Y A286145 Cf. A046092 (row 0), A000096 (column 0), A000217 (main diagonal).
%Y A286145 Cf. A003987, A001477, A286108, A286109, A286150, A286151.
%K A286145 nonn,tabl
%O A286145 0,2
%A A286145 _Antti Karttunen_, May 03 2017