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.

Showing 1-6 of 6 results.

A286151 Square array read by descending antidiagonals: If n > k, A(n,k) = T(n XOR k, k), and otherwise A(n,k) = T(n, n XOR k), where T(n,k) is sequence A001477 considered as a two-dimensional table, and XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 1, 2, 3, 2, 5, 6, 11, 13, 9, 10, 7, 5, 8, 14, 15, 22, 8, 7, 26, 20, 21, 16, 38, 9, 42, 19, 27, 28, 37, 47, 58, 62, 52, 43, 35, 36, 29, 23, 48, 14, 51, 25, 34, 44, 45, 56, 30, 39, 19, 16, 41, 33, 64, 54, 55, 46, 80, 31, 25, 20, 23, 32, 88, 53, 65, 66, 79, 93, 108, 32, 41, 39, 31, 116, 102, 89, 77, 78, 67, 57, 94, 140, 33, 27, 30, 148, 101, 63, 76, 90
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
   2,   2,  11,   7,  22,  16,  37,  29,  56,  46,  79,  67, 106
   5,  13,   5,   8,  38,  47,  23,  30,  80,  93,  57,  68, 138
   9,   8,   7,   9,  58,  48,  39,  31, 108,  94,  81,  69, 174
  14,  26,  42,  62,  14,  19,  25,  32, 140, 157, 175, 194,  82
  20,  19,  52,  51,  16,  20,  41,  33, 176, 158, 215, 195, 110
  27,  43,  25,  41,  23,  39,  27,  34, 216, 237, 177, 196, 142
  35,  34,  33,  32,  31,  30,  29,  35, 260, 238, 217, 197, 178
  44,  64,  88, 116, 148, 184, 224, 268,  44,  53,  63,  74,  86
  54,  53, 102, 101, 166, 165, 246, 245,  46,  54,  87,  75, 114
  65,  89,  63,  87, 185, 225, 183, 223,  57,  81,  65,  76, 146
  77,  76,  75,  74, 205, 204, 203, 202,  69,  68,  67,  77, 182
  90, 118, 150, 186,  86, 114, 146, 182,  82, 110, 142, 178,  90
		

Crossrefs

Cf. A000217 (row 0), A000096 (column 0 and the main diagonal).
Cf. A286153 (same array without row 0 and column 0).

Programs

  • Mathematica
    T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=If[n>k, T[BitXor[n, k], k], T[n, BitXor[n, k]]]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 20 2017 *)
  • Python
    def T(a, b): return ((a + b)**2 + 3*a + b)//2
    def A(n, k): return T(n^k, k) if n>k else T(n, n^k)
    for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, May 20 2017
  • Scheme
    (define (A286151 n) (A286151bi (A002262 n) (A025581 n)))
    (define (A286151bi row col) (define (pairA001477bi a b) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2)) (cond ((> row col) (pairA001477bi (A003987bi row col) col)) (else (pairA001477bi row (A003987bi col row))))) ;; Where A003987bi implements bitwise-xor (A003987).
    

Formula

If n > k, A(n,k) = T(A003987(n,k),k), otherwise A(n,k) = T(n,A003987(n,k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, and XOR is bitwise-xor (A003987).

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

Original entry on oeis.org

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, 25, 27, 35, 35, 35, 35, 35, 35, 35, 35, 44, 42, 40, 42, 36, 42, 40, 42, 44, 54, 54, 50, 50, 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
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,   2,   5,   9,  14,  20,  27,  35,  44,  54,  65,  77,  90
   2,   3,   9,  12,  20,  25,  35,  42,  54,  63,  77,  88, 104
   5,   9,  10,  16,  27,  35,  40,  50,  65,  77,  86, 100, 119
   9,  12,  16,  21,  35,  42,  50,  59,  77,  88, 100, 113, 135
  14,  20,  27,  35,  36,  46,  57,  69,  90, 104, 119, 135, 144
  20,  25,  35,  42,  46,  55,  69,  80, 104, 117, 135, 150, 162
  27,  35,  40,  50,  57,  69,  78,  92, 119, 135, 148, 166, 181
  35,  42,  50,  59,  69,  80,  92, 105, 135, 150, 166, 183, 201
  44,  54,  65,  77,  90, 104, 119, 135, 136, 154, 173, 193, 214
  54,  63,  77,  88, 104, 117, 135, 150, 154, 171, 193, 212, 236
  65,  77,  86, 100, 119, 135, 148, 166, 173, 193, 210, 232, 259
  77,  88, 100, 113, 135, 150, 166, 183, 193, 212, 232, 253, 283
  90, 104, 119, 135, 144, 162, 181, 201, 214, 236, 259, 283, 300
		

Crossrefs

Cf. A000096 (row 0 & column 0), A014105 (main diagonal).

Programs

  • Mathematica
    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 *)
  • Python
    def T(a, b): return ((a + b)**2 + 3*a + b)//2
    def A(n, k): return T(n^k, 2*(n&k))
    for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, May 20 2017
  • Scheme
    (define (A286109 n) (A286109bi (A002262 n) (A025581 n)))
    (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).
    

Formula

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

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

Original entry on oeis.org

0, 4, 2, 12, 1, 5, 24, 18, 13, 9, 40, 17, 3, 8, 14, 60, 50, 11, 7, 26, 20, 84, 49, 61, 6, 42, 19, 27, 112, 98, 85, 73, 62, 52, 43, 35, 144, 97, 59, 72, 10, 51, 25, 34, 44, 180, 162, 83, 71, 22, 16, 41, 33, 64, 54, 220, 161, 181, 70, 38, 15, 23, 32, 88, 53, 65, 264, 242, 221, 201, 58, 48, 39, 31, 116, 102, 89, 77, 312, 241, 179, 200, 222, 47, 21, 30, 148, 101, 63, 76, 90
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,   4,  12,  24,  40,  60,  84, 112, 144, 180, 220, 264, 312
   2,   1,  18,  17,  50,  49,  98,  97, 162, 161, 242, 241, 338
   5,  13,   3,  11,  61,  85,  59,  83, 181, 221, 179, 219, 365
   9,   8,   7,   6,  73,  72,  71,  70, 201, 200, 199, 198, 393
  14,  26,  42,  62,  10,  22,  38,  58, 222, 266, 314, 366, 218
  20,  19,  52,  51,  16,  15,  48,  47, 244, 243, 340, 339, 240
  27,  43,  25,  41,  23,  39,  21,  37, 267, 315, 265, 313, 263
  35,  34,  33,  32,  31,  30,  29,  28, 291, 290, 289, 288, 287
  44,  64,  88, 116, 148, 184, 224, 268,  36,  56,  80, 108, 140
  54,  53, 102, 101, 166, 165, 246, 245,  46,  45,  94,  93, 158
  65,  89,  63,  87, 185, 225, 183, 223,  57,  81,  55,  79, 177
  77,  76,  75,  74, 205, 204, 203, 202,  69,  68,  67,  66, 197
  90, 118, 150, 186,  86, 114, 146, 182,  82, 110, 142, 178,  78
		

Crossrefs

Transpose: A286147.
Cf. A046092 (row 0), A000096 (column 0), A000217 (main diagonal).

Programs

  • Mathematica
    T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], k]; Table[A[k, n - 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, k)
    for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, May 21 2017
  • Scheme
    (define (A286145 n) (A286145bi (A002262 n) (A025581 n)))
    (define (A286145bi row col) (let ((a (A003987bi row col)) (b col)) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Where A003987bi implements bitwise-xor (A003987).
    

Formula

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

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

Original entry on oeis.org

0, 2, 4, 5, 1, 12, 9, 13, 18, 24, 14, 8, 3, 17, 40, 20, 26, 7, 11, 50, 60, 27, 19, 42, 6, 61, 49, 84, 35, 43, 52, 62, 73, 85, 98, 112, 44, 34, 25, 51, 10, 72, 59, 97, 144, 54, 64, 33, 41, 16, 22, 71, 83, 162, 180, 65, 53, 88, 32, 23, 15, 38, 70, 181, 161, 220, 77, 89, 102, 116, 31, 39, 48, 58, 201, 221, 242, 264, 90, 76, 63, 101, 148, 30, 21, 47, 222, 200, 179, 241, 312
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,   2,   5,   9,  14,  20,  27,  35,  44,  54,  65,  77,  90
    4,   1,  13,   8,  26,  19,  43,  34,  64,  53,  89,  76, 118
   12,  18,   3,   7,  42,  52,  25,  33,  88, 102,  63,  75, 150
   24,  17,  11,   6,  62,  51,  41,  32, 116, 101,  87,  74, 186
   40,  50,  61,  73,  10,  16,  23,  31, 148, 166, 185, 205,  86
   60,  49,  85,  72,  22,  15,  39,  30, 184, 165, 225, 204, 114
   84,  98,  59,  71,  38,  48,  21,  29, 224, 246, 183, 203, 146
  112,  97,  83,  70,  58,  47,  37,  28, 268, 245, 223, 202, 182
  144, 162, 181, 201, 222, 244, 267, 291,  36,  46,  57,  69,  82
  180, 161, 221, 200, 266, 243, 315, 290,  56,  45,  81,  68, 110
  220, 242, 179, 199, 314, 340, 265, 289,  80,  94,  55,  67, 142
  264, 241, 219, 198, 366, 339, 313, 288, 108,  93,  79,  66, 178
  312, 338, 365, 393, 218, 240, 263, 287, 140, 158, 177, 197,  78
		

Crossrefs

Transpose: A286145.
Cf. A000096 (row 0), A046092 (column 0), A000217 (main diagonal).

Programs

  • Mathematica
    T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], 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, k)
    for n in range(21): print([A(n - k, k) for k in range(n + 1)]) # Indranil Ghosh, May 21 2017
  • Scheme
    (define (A286147 n) (A286147bi (A002262 n) (A025581 n)))
    (define (A286147bi row col) (let ((a (A003987bi row col)) (b row)) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Where A003987bi implements bitwise-xor (A003987).
    

Formula

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

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

Original entry on oeis.org

0, 2, 2, 5, 1, 5, 9, 13, 13, 9, 14, 8, 3, 8, 14, 20, 26, 7, 7, 26, 20, 27, 19, 42, 6, 42, 19, 27, 35, 43, 52, 62, 62, 52, 43, 35, 44, 34, 25, 51, 10, 51, 25, 34, 44, 54, 64, 33, 41, 16, 16, 41, 33, 64, 54, 65, 53, 88, 32, 23, 15, 23, 32, 88, 53, 65, 77, 89, 102, 116, 31, 39, 39, 31, 116, 102, 89, 77, 90, 76, 63, 101, 148, 30, 21, 30, 148, 101, 63, 76, 90
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,   2,   5,   9,  14,  20,  27,  35,  44,  54,  65,  77,  90
   2,   1,  13,   8,  26,  19,  43,  34,  64,  53,  89,  76, 118
   5,  13,   3,   7,  42,  52,  25,  33,  88, 102,  63,  75, 150
   9,   8,   7,   6,  62,  51,  41,  32, 116, 101,  87,  74, 186
  14,  26,  42,  62,  10,  16,  23,  31, 148, 166, 185, 205,  86
  20,  19,  52,  51,  16,  15,  39,  30, 184, 165, 225, 204, 114
  27,  43,  25,  41,  23,  39,  21,  29, 224, 246, 183, 203, 146
  35,  34,  33,  32,  31,  30,  29,  28, 268, 245, 223, 202, 182
  44,  64,  88, 116, 148, 184, 224, 268,  36,  46,  57,  69,  82
  54,  53, 102, 101, 166, 165, 246, 245,  46,  45,  81,  68, 110
  65,  89,  63,  87, 185, 225, 183, 223,  57,  81,  55,  67, 142
  77,  76,  75,  74, 205, 204, 203, 202,  69,  68,  67,  66, 178
  90, 118, 150, 186,  86, 114, 146, 182,  82, 110, 142, 178,  78
		

Crossrefs

Cf. A000096 (row 0 & column 0), A000217 (main diagonal).

Programs

  • Mathematica
    T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k],Min[n,  k]]; Table[A[k, n - 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, min(n, k))
    for n in range(21): print([A(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, May 21 2017
  • Scheme
    (define (A286150 n) (A286150bi (A002262 n) (A025581 n)))
    (define (A286150bi row col) (let ((a (A003987bi row col)) (b (min col row))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Where A003987bi implements bitwise-xor (A003987).
    

Formula

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

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, ...].
Showing 1-6 of 6 results.