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.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

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

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
		

Crossrefs

Cf. A000217 (row 0 & column 0), A084263 (seems to be row 1 & column 1), A046092 (main diagonal).
Cf. also arrays A286099, A286101, A286102, A286108.

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

Formula

A(n,k) = T(A004198(n,k), A003986(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, ...].