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.

A286099 Square array read by antidiagonals: A(n,k) = T(n OR k, n AND k), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and OR is bitwise-or (A003986).

This page as a plain text file.
%I A286099 #20 Jun 12 2025 00:47:09
%S A286099 0,2,2,5,4,5,9,9,9,9,14,13,12,13,14,20,20,18,18,20,20,27,26,27,24,27,
%T A286099 26,27,35,35,35,35,35,35,35,35,44,43,42,43,40,43,42,43,44,54,54,52,52,
%U A286099 50,50,52,52,54,54,65,64,65,62,61,60,61,62,65,64,65,77,77,77,77,73,73,73,73,77,77,77,77,90,89,88,89,90,85,84,85,90,89,88,89,90
%N A286099 Square array read by antidiagonals: A(n,k) = T(n OR k, n AND k), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and OR is bitwise-or (A003986).
%C A286099 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 A286099 Antti Karttunen, <a href="/A286099/b286099.txt">Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array</a>
%H A286099 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286099 A(n,k) = T(A003986(n,k), 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 A286099 The top left 0 .. 12 x 0 .. 12 corner of the array:
%e A286099    0,   2,   5,   9,  14,  20,  27,  35,  44,  54,  65,  77,  90
%e A286099    2,   4,   9,  13,  20,  26,  35,  43,  54,  64,  77,  89, 104
%e A286099    5,   9,  12,  18,  27,  35,  42,  52,  65,  77,  88, 102, 119
%e A286099    9,  13,  18,  24,  35,  43,  52,  62,  77,  89, 102, 116, 135
%e A286099   14,  20,  27,  35,  40,  50,  61,  73,  90, 104, 119, 135, 148
%e A286099   20,  26,  35,  43,  50,  60,  73,  85, 104, 118, 135, 151, 166
%e A286099   27,  35,  42,  52,  61,  73,  84,  98, 119, 135, 150, 168, 185
%e A286099   35,  43,  52,  62,  73,  85,  98, 112, 135, 151, 168, 186, 205
%e A286099   44,  54,  65,  77,  90, 104, 119, 135, 144, 162, 181, 201, 222
%e A286099   54,  64,  77,  89, 104, 118, 135, 151, 162, 180, 201, 221, 244
%e A286099   65,  77,  88, 102, 119, 135, 150, 168, 181, 201, 220, 242, 267
%e A286099   77,  89, 102, 116, 135, 151, 168, 186, 201, 221, 242, 264, 291
%e A286099   90, 104, 119, 135, 148, 166, 185, 205, 222, 244, 267, 291, 312
%t A286099 T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitOr[n, k],BitAnd[n,  k]]; Table[A[n - k, k], {n, 0, 20}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, May 21 2017 *)
%o A286099 (Scheme)
%o A286099 (define (A286099 n) (A286099bi (A002262 n) (A025581 n)))
%o A286099 (define (A286099bi row col) (let ((a (A003986bi row col)) (b (A004198bi row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003986bi and A004198bi implement bitwise-OR (A003986) and bitwise-AND (A004198).
%o A286099 (Python)
%o A286099 def T(a, b): return ((a + b)**2 + 3*a + b)//2
%o A286099 def A(n, k): return T(n|k, n&k)
%o A286099 for n in range(0, 21): print([A(k, n - k) for k in range(0, n + 1)]) # _Indranil Ghosh_, May 21 2017
%Y A286099 Cf. A000096 (row 0 & column 0), A162761 (seems to be row 1 & column 1), A046092 (main diagonal).
%Y A286099 Cf. A003056, A003986, A004198.
%Y A286099 Cf. also arrays A286098, A286101, A286102, A286109.
%K A286099 nonn,tabl
%O A286099 0,2
%A A286099 _Antti Karttunen_, May 03 2017