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.

A286108 Square array read by antidiagonals: A(n,k) = T(2*(n AND k), n XOR 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 A286108 #22 Feb 16 2025 08:33:44
%S A286108 0,1,1,3,5,3,6,6,6,6,10,12,14,12,10,15,15,19,19,15,15,21,23,21,27,21,
%T A286108 23,21,28,28,28,28,28,28,28,28,36,38,40,38,44,38,40,38,36,45,45,49,49,
%U A286108 53,53,49,49,45,45,55,57,55,61,63,65,63,61,55,57,55,66,66,66,66,74,74,74,74,66,66,66,66,78,80,82,80,78,88,90,88,78,80,82,80,78
%N A286108 Square array read by antidiagonals: A(n,k) = T(2*(n AND k), n XOR 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 A286108 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 A286108 Antti Karttunen, <a href="/A286108/b286108.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H A286108 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286108 A(n,k) = T(2*A004198(n,k), A003987(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 A286108 The top left 0 .. 12 x 0 .. 12 corner of the array:
%e A286108    0,  1,   3,   6,  10,  15,  21,  28,  36,  45,  55,  66,  78
%e A286108    1,  5,   6,  12,  15,  23,  28,  38,  45,  57,  66,  80,  91
%e A286108    3,  6,  14,  19,  21,  28,  40,  49,  55,  66,  82,  95, 105
%e A286108    6, 12,  19,  27,  28,  38,  49,  61,  66,  80,  95, 111, 120
%e A286108   10, 15,  21,  28,  44,  53,  63,  74,  78,  91, 105, 120, 144
%e A286108   15, 23,  28,  38,  53,  65,  74,  88,  91, 107, 120, 138, 161
%e A286108   21, 28,  40,  49,  63,  74,  90, 103, 105, 120, 140, 157, 179
%e A286108   28, 38,  49,  61,  74,  88, 103, 119, 120, 138, 157, 177, 198
%e A286108   36, 45,  55,  66,  78,  91, 105, 120, 152, 169, 187, 206, 226
%e A286108   45, 57,  66,  80,  91, 107, 120, 138, 169, 189, 206, 228, 247
%e A286108   55, 66,  82,  95, 105, 120, 140, 157, 187, 206, 230, 251, 269
%e A286108   66, 80,  95, 111, 120, 138, 157, 177, 206, 228, 251, 275, 292
%e A286108   78, 91, 105, 120, 144, 161, 179, 198, 226, 247, 269, 292, 324
%t A286108 T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[2*BitAnd[n, k], BitXor[n, k]]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, May 20 2017 *)
%o A286108 (Scheme)
%o A286108 (define (A286108 n) (A286108bi (A002262 n) (A025581 n)))
%o A286108 (define (A286108bi row col) (let ((a (* 2 (A004198bi row col))) (b (A003987bi row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003987bi and A004198bi implement bitwise-xor (A003987) and bitwise-and (A004198).
%o A286108 (Python)
%o A286108 def T(a, b): return ((a + b)**2 + 3*a + b)//2
%o A286108 def A(n, k): return T(2*(n&k), n^k)
%o A286108 for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # _Indranil Ghosh_, May 20 2017
%Y A286108 Cf. A000217 (row 0 & column 0), A014106 (main diagonal).
%Y A286108 Cf. A003056, A003987, A004198.
%Y A286108 Cf. also arrays A286098, A286109, A286145, A286147, A286150, A286151.
%K A286108 nonn,tabl
%O A286108 0,4
%A A286108 _Antti Karttunen_, May 03 2017