A286098 Square array read by antidiagonals: A(n,k) = T(n AND k, n OR 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).
0, 1, 1, 3, 4, 3, 6, 6, 6, 6, 10, 11, 12, 11, 10, 15, 15, 17, 17, 15, 15, 21, 22, 21, 24, 21, 22, 21, 28, 28, 28, 28, 28, 28, 28, 28, 36, 37, 38, 37, 40, 37, 38, 37, 36, 45, 45, 47, 47, 49, 49, 47, 47, 45, 45, 55, 56, 55, 58, 59, 60, 59, 58, 55, 56, 55, 66, 66, 66, 66, 70, 70, 70, 70, 66, 66, 66, 66, 78, 79, 80, 79, 78, 83, 84, 83, 78, 79, 80, 79, 78
Offset: 0
Examples
The top left 0 .. 12 x 0 .. 12 corner of the array: 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78 1, 4, 6, 11, 15, 22, 28, 37, 45, 56, 66, 79, 91 3, 6, 12, 17, 21, 28, 38, 47, 55, 66, 80, 93, 105 6, 11, 17, 24, 28, 37, 47, 58, 66, 79, 93, 108, 120 10, 15, 21, 28, 40, 49, 59, 70, 78, 91, 105, 120, 140 15, 22, 28, 37, 49, 60, 70, 83, 91, 106, 120, 137, 157 21, 28, 38, 47, 59, 70, 84, 97, 105, 120, 138, 155, 175 28, 37, 47, 58, 70, 83, 97, 112, 120, 137, 155, 174, 194 36, 45, 55, 66, 78, 91, 105, 120, 144, 161, 179, 198, 218 45, 56, 66, 79, 91, 106, 120, 137, 161, 180, 198, 219, 239 55, 66, 80, 93, 105, 120, 138, 155, 179, 198, 220, 241, 261 66, 79, 93, 108, 120, 137, 155, 174, 198, 219, 241, 264, 284 78, 91, 105, 120, 140, 157, 175, 194, 218, 239, 261, 284, 312
Links
- Antti Karttunen, Table of n, a(n) for n = 0..10584; the first 145 antidiagonals of array
- Eric Weisstein's World of Mathematics, Pairing Function
Crossrefs
Programs
-
Mathematica
T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitAnd[n, k],BitOr[n, k]]; Table[A[n - k, k], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 21 2017 *)
-
Python
def T(a, b): return ((a + b)**2 + 3*a + b)//2 def A(n, k): return T(n&k, n|k) for n in range(0, 21): print([A(k, n - k) for k in range(0, n + 1)]) # Indranil Ghosh, May 21 2017
-
Scheme
(define (A286098 n) (A286098bi (A002262 n) (A025581 n))) (define (A286098bi row col) (let ((a (A004198bi row col)) (b (A003986bi row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003986bi and A004198bi implement bitwise-OR (A003986) and bitwise-AND (A004198).
Comments