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.

A286109 Square array read by antidiagonals: A(n,k) = T(n XOR k, 2*(n AND k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and XOR is bitwise-xor (A003987).

This page as a plain text file.
%I A286109 #22 Feb 16 2025 08:33:44
%S A286109 0,2,2,5,3,5,9,9,9,9,14,12,10,12,14,20,20,16,16,20,20,27,25,27,21,27,
%T A286109 25,27,35,35,35,35,35,35,35,35,44,42,40,42,36,42,40,42,44,54,54,50,50,
%U A286109 46,46,50,50,54,54,65,63,65,59,57,55,57,59,65,63,65,77,77,77,77,69,69,69,69,77,77,77,77,90,88,86,88,90,80,78,80,90,88,86,88,90
%N A286109 Square array read by antidiagonals: A(n,k) = T(n XOR k, 2*(n AND k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and XOR is bitwise-xor (A003987).
%C A286109 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 A286109 Antti Karttunen, <a href="/A286109/b286109.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H A286109 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286109 A(n,k) = T(A003987(n,k), 2*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 A286109 The top left 0 .. 12 x 0 .. 12 corner of the array:
%e A286109    0,   2,   5,   9,  14,  20,  27,  35,  44,  54,  65,  77,  90
%e A286109    2,   3,   9,  12,  20,  25,  35,  42,  54,  63,  77,  88, 104
%e A286109    5,   9,  10,  16,  27,  35,  40,  50,  65,  77,  86, 100, 119
%e A286109    9,  12,  16,  21,  35,  42,  50,  59,  77,  88, 100, 113, 135
%e A286109   14,  20,  27,  35,  36,  46,  57,  69,  90, 104, 119, 135, 144
%e A286109   20,  25,  35,  42,  46,  55,  69,  80, 104, 117, 135, 150, 162
%e A286109   27,  35,  40,  50,  57,  69,  78,  92, 119, 135, 148, 166, 181
%e A286109   35,  42,  50,  59,  69,  80,  92, 105, 135, 150, 166, 183, 201
%e A286109   44,  54,  65,  77,  90, 104, 119, 135, 136, 154, 173, 193, 214
%e A286109   54,  63,  77,  88, 104, 117, 135, 150, 154, 171, 193, 212, 236
%e A286109   65,  77,  86, 100, 119, 135, 148, 166, 173, 193, 210, 232, 259
%e A286109   77,  88, 100, 113, 135, 150, 166, 183, 193, 212, 232, 253, 283
%e A286109   90, 104, 119, 135, 144, 162, 181, 201, 214, 236, 259, 283, 300
%t A286109 T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], 2*BitAnd[n, k]]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, May 20 2017 *)
%o A286109 (Scheme)
%o A286109 (define (A286109 n) (A286109bi (A002262 n) (A025581 n)))
%o A286109 (define (A286109bi row col) (let ((a (A003987bi row col)) (b (* 2 (A004198bi row col)))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003987bi and A004198bi implement bitwise-xor (A003987) and bitwise-and (A004198).
%o A286109 (Python)
%o A286109 def T(a, b): return ((a + b)**2 + 3*a + b)//2
%o A286109 def A(n, k): return T(n^k, 2*(n&k))
%o A286109 for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # _Indranil Ghosh_, May 20 2017
%Y A286109 Cf. A000096 (row 0 & column 0), A014105 (main diagonal).
%Y A286109 Cf. A003056, A003987, A004198.
%Y A286109 Cf. also arrays A286099, A286108, A286145, A286147, A286150, A286151.
%K A286109 nonn,tabl
%O A286109 0,2
%A A286109 _Antti Karttunen_, May 03 2017