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-7 of 7 results.

A286146 Lower triangular region of square array A286101.

Original entry on oeis.org

1, 2, 5, 4, 16, 13, 7, 12, 67, 25, 11, 46, 106, 191, 41, 16, 23, 31, 80, 436, 61, 22, 92, 211, 379, 596, 862, 85, 29, 38, 277, 59, 781, 302, 1541, 113, 37, 154, 58, 631, 991, 193, 1954, 2557, 145, 46, 57, 436, 212, 96, 467, 2416, 822, 4006, 181, 56, 232, 529, 947, 1486, 2146, 2927, 3829, 4852, 5996, 221, 67, 80, 94, 109, 1771, 142, 3487, 355, 706, 1832, 8647
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Examples

			The first twelve rows of the triangle:
   1,
   2,   5,
   4,  16,  13,
   7,  12,  67,  25,
  11,  46, 106, 191,   41,
  16,  23,  31,  80,  436,   61,
  22,  92, 211, 379,  596,  862,   85,
  29,  38, 277,  59,  781,  302, 1541,  113,
  37, 154,  58, 631,  991,  193, 1954, 2557,  145,
  46,  57, 436, 212,   96,  467, 2416,  822, 4006,  181,
  56, 232, 529, 947, 1486, 2146, 2927, 3829, 4852, 5996,  221,
  67,  80,  94, 109, 1771,  142, 3487,  355,  706, 1832, 8647, 265
  ----------------------------------------------------------------
For T(4,3) we have gcd(4,3) = 1 and lcm(4,3) = 12, thus T(4,3) = (1/2)*(2 + (12+1)^2 - 1 - 3*12) = 67.
For T(6,4) we have gcd(6,4) = 2 and lcm(6,4) = 12, thus T(6,4) = (1/2)*(2 + (12+2)^2 - 2 - 3*12) = 80.
For T(12,1) we have gcd(12,1) = 1 and lcm(12,1) = 12, thus T(12,1) = T(4,3) = 67.
For T(12,2) we have gcd(12,2) = 2 and lcm(12,1) = 12, thus T(12,1) = T(6,4) = 80.
For T(12,8) we have gcd(12,8) = 4 and lcm(12,8) = 24, thus T(12,8) = (1/2)*(2 + (24+4)^2 - 4 - 3*24) = 355.
		

Crossrefs

Cf. A286101.
Cf. A286148 (same triangle reversed).
Cf. A000124 (the left edge), A001844 (the right edge).

Programs

  • Python
    from sympy import lcm, gcd
    def t(n, k): return (2 + ((gcd(n, k) + lcm(n, k))**2) - gcd(n, k) - 3*lcm(n, k))/2
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 11 2017
  • Scheme
    (define (A286146 n) (A286101bi (A002024 n) (A002260 n))) ;; For A286101bi see A286101.
    

Formula

As a triangle (with n >= 1, 1 <= k <= n):
T(n,k) = (1/2)*(2 + ((gcd(n,k)+lcm(n,k))^2) - gcd(n,k) - 3*lcm(n,k)).

A286156 A(n,k) = T(remainder(n,k), quotient(n,k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, square array read by descending antidiagonals.

Original entry on oeis.org

1, 2, 3, 2, 1, 6, 2, 5, 4, 10, 2, 5, 1, 3, 15, 2, 5, 9, 4, 7, 21, 2, 5, 9, 1, 8, 6, 28, 2, 5, 9, 14, 4, 3, 11, 36, 2, 5, 9, 14, 1, 8, 7, 10, 45, 2, 5, 9, 14, 20, 4, 13, 12, 16, 55, 2, 5, 9, 14, 20, 1, 8, 3, 6, 15, 66, 2, 5, 9, 14, 20, 27, 4, 13, 7, 11, 22, 78, 2, 5, 9, 14, 20, 27, 1, 8, 19, 12, 17, 21, 91, 2, 5, 9, 14, 20, 27, 35, 4, 13, 3, 18, 10, 29, 105
Offset: 1

Views

Author

Antti Karttunen, May 04 2017

Keywords

Examples

			The top left 15 X 15 corner of the array:
    1,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,   2,   2
    3,  1,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,   5,   5
    6,  4,  1,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,   9,   9
   10,  3,  4,  1, 14, 14, 14, 14, 14, 14, 14, 14, 14,  14,  14
   15,  7,  8,  4,  1, 20, 20, 20, 20, 20, 20, 20, 20,  20,  20
   21,  6,  3,  8,  4,  1, 27, 27, 27, 27, 27, 27, 27,  27,  27
   28, 11,  7, 13,  8,  4,  1, 35, 35, 35, 35, 35, 35,  35,  35
   36, 10, 12,  3, 13,  8,  4,  1, 44, 44, 44, 44, 44,  44,  44
   45, 16,  6,  7, 19, 13,  8,  4,  1, 54, 54, 54, 54,  54,  54
   55, 15, 11, 12,  3, 19, 13,  8,  4,  1, 65, 65, 65,  65,  65
   66, 22, 17, 18,  7, 26, 19, 13,  8,  4,  1, 77, 77,  77,  77
   78, 21, 10,  6, 12,  3, 26, 19, 13,  8,  4,  1, 90,  90,  90
   91, 29, 16, 11, 18,  7, 34, 26, 19, 13,  8,  4,  1, 104, 104
  105, 28, 23, 17, 25, 12,  3, 34, 26, 19, 13,  8,  4,   1, 119
  120, 37, 15, 24,  6, 18,  7, 43, 34, 26, 19, 13,  8,   4,   1
		

Crossrefs

Cf. A286157 (transpose), A286158 (lower triangular region), A286159 (lower triangular region transposed).
Cf. A000217 (column 1), A000012 (the main diagonal), A000096 (superdiagonal), A034856.

Programs

  • Mathematica
    Map[((#1 + #2)^2 + 3 #1 + #2)/2 & @@ # & /@ Reverse@ # &, Table[Function[m, Reverse@ QuotientRemainder[m, k]][n - k + 1], {n, 14}, {k, n}]] // Flatten (* Michael De Vlieger, May 20 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(1, 21): print([A(k, n - k + 1) for k in range(1, n + 1)])  # Indranil Ghosh, May 20 2017
  • Scheme
    (define (A286156 n) (A286156bi (A002260 n) (A004736 n)))
    (define (A286156bi row col) (if (zero? col) -1 (let ((a (remainder row col)) (b (quotient row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))))
    

Formula

A(n,k) = T(remainder(n,k), quotient(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, ...]. This sequence lists only values for indices n >= 1, k >= 1.

A286102 Square array A(n,k) read by antidiagonals: A(n,k) = T(lcm(n,k), gcd(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table.

Original entry on oeis.org

1, 3, 3, 6, 5, 6, 10, 21, 21, 10, 15, 14, 13, 14, 15, 21, 55, 78, 78, 55, 21, 28, 27, 120, 25, 120, 27, 28, 36, 105, 34, 210, 210, 34, 105, 36, 45, 44, 231, 90, 41, 90, 231, 44, 45, 55, 171, 300, 406, 465, 465, 406, 300, 171, 55, 66, 65, 64, 63, 630, 61, 630, 63, 64, 65, 66, 78, 253, 465, 666, 820, 903, 903, 820, 666, 465, 253, 78, 91, 90, 561, 230, 1035, 324, 85, 324, 1035, 230, 561, 90, 91
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Examples

			The top left 12 X 12 corner of the array:
   1,   3,   6,  10,   15,   21,   28,   36,   45,   55,   66,   78
   3,   5,  21,  14,   55,   27,  105,   44,  171,   65,  253,   90
   6,  21,  13,  78,  120,   34,  231,  300,   64,  465,  561,  103
  10,  14,  78,  25,  210,   90,  406,   63,  666,  230,  990,  117
  15,  55, 120, 210,   41,  465,  630,  820, 1035,  101, 1540, 1830
  21,  27,  34,  90,  465,   61,  903,  324,  208,  495, 2211,  148
  28, 105, 231, 406,  630,  903,   85, 1596, 2016, 2485, 3003, 3570
  36,  44, 300,  63,  820,  324, 1596,  113, 2628,  860, 3916,  375
  45, 171,  64, 666, 1035,  208, 2016, 2628,  145, 4095, 4950,  739
  55,  65, 465, 230,  101,  495, 2485,  860, 4095,  181, 6105, 1890
  66, 253, 561, 990, 1540, 2211, 3003, 3916, 4950, 6105,  221, 8778
  78,  90, 103, 117, 1830,  148, 3570,  375,  739, 1890, 8778,  265
		

Crossrefs

Cf. A000217 (row 1 and column 1), A001844 (main diagonal).

Programs

Formula

A(n,k) = T(lcm(n,k), gcd(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table, that is, as a pairing function from N x N to N.
A(n,k) = A(k,n), or equivalently, a(A038722(n)) = a(n). [Array is symmetric.]

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

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

Original entry on oeis.org

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, 26, 27, 35, 35, 35, 35, 35, 35, 35, 35, 44, 43, 42, 43, 40, 43, 42, 43, 44, 54, 54, 52, 52, 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
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,   4,   9,  13,  20,  26,  35,  43,  54,  64,  77,  89, 104
   5,   9,  12,  18,  27,  35,  42,  52,  65,  77,  88, 102, 119
   9,  13,  18,  24,  35,  43,  52,  62,  77,  89, 102, 116, 135
  14,  20,  27,  35,  40,  50,  61,  73,  90, 104, 119, 135, 148
  20,  26,  35,  43,  50,  60,  73,  85, 104, 118, 135, 151, 166
  27,  35,  42,  52,  61,  73,  84,  98, 119, 135, 150, 168, 185
  35,  43,  52,  62,  73,  85,  98, 112, 135, 151, 168, 186, 205
  44,  54,  65,  77,  90, 104, 119, 135, 144, 162, 181, 201, 222
  54,  64,  77,  89, 104, 118, 135, 151, 162, 180, 201, 221, 244
  65,  77,  88, 102, 119, 135, 150, 168, 181, 201, 220, 242, 267
  77,  89, 102, 116, 135, 151, 168, 186, 201, 221, 242, 264, 291
  90, 104, 119, 135, 148, 166, 185, 205, 222, 244, 267, 291, 312
		

Crossrefs

Cf. A000096 (row 0 & column 0), A162761 (seems to be row 1 & column 1), A046092 (main diagonal).
Cf. also arrays A286098, A286101, A286102, A286109.

Programs

  • Mathematica
    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 *)
  • 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 (A286099 n) (A286099bi (A002262 n) (A025581 n)))
    (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).
    

Formula

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

A285724 Square array read by descending antidiagonals: If n > k, A(n,k) = T(lcm(n,k), gcd(n,k)), otherwise A(n,k) = T(gcd(n,k), lcm(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 16, 21, 10, 11, 12, 13, 14, 15, 16, 46, 67, 78, 55, 21, 22, 23, 106, 25, 120, 27, 28, 29, 92, 31, 191, 210, 34, 105, 36, 37, 38, 211, 80, 41, 90, 231, 44, 45, 46, 154, 277, 379, 436, 465, 406, 300, 171, 55, 56, 57, 58, 59, 596, 61, 630, 63, 64, 65, 66, 67, 232, 436, 631, 781, 862, 903, 820, 666, 465, 253, 78, 79, 80, 529, 212, 991, 302, 85, 324, 1035, 230, 561, 90, 91
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Examples

			The top left 12 X 12 corner of the array:
   1,   2,   4,   7,   11,   16,   22,   29,   37,   46,   56,   67
   3,   5,  16,  12,   46,   23,   92,   38,  154,   57,  232,   80
   6,  21,  13,  67,  106,   31,  211,  277,   58,  436,  529,   94
  10,  14,  78,  25,  191,   80,  379,   59,  631,  212,  947,  109
  15,  55, 120, 210,   41,  436,  596,  781,  991,   96, 1486, 1771
  21,  27,  34,  90,  465,   61,  862,  302,  193,  467, 2146,  142
  28, 105, 231, 406,  630,  903,   85, 1541, 1954, 2416, 2927, 3487
  36,  44, 300,  63,  820,  324, 1596,  113, 2557,  822, 3829,  355
  45, 171,  64, 666, 1035,  208, 2016, 2628,  145, 4006, 4852,  706
  55,  65, 465, 230,  101,  495, 2485,  860, 4095,  181, 5996, 1832
  66, 253, 561, 990, 1540, 2211, 3003, 3916, 4950, 6105,  221, 8647
  78,  90, 103, 117, 1830,  148, 3570,  375,  739, 1890, 8778,  265
		

Crossrefs

Cf. A000124 (row 1), A000217 (column 1), A001844 (main diagonal).

Programs

  • Scheme
    (define (A285724 n) (A285724bi (A002260 n) (A004736 n)))
    (define (A285724bi row col) (if (> row col) (A000027bi (lcm row col) (gcd row col)) (A000027bi (gcd row col) (lcm row col))))
    (define (A000027bi row col) (* (/ 1 2) (+ (expt (+ row col) 2) (- row) (- (* 3 col)) 2)))

Formula

If n > k, A(n,k) = T(lcm(n,k),gcd(n,k)), otherwise A(n,k) = T(gcd(n,k),lcm(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table, that is, as a pairing function from N x N to N.
If n < k, A(n,k) = A286101(n,k), otherwise A(n,k) = A286102(n,k).

A286148 Triangle A286146 reversed.

Original entry on oeis.org

1, 5, 2, 13, 16, 4, 25, 67, 12, 7, 41, 191, 106, 46, 11, 61, 436, 80, 31, 23, 16, 85, 862, 596, 379, 211, 92, 22, 113, 1541, 302, 781, 59, 277, 38, 29, 145, 2557, 1954, 193, 991, 631, 58, 154, 37, 181, 4006, 822, 2416, 467, 96, 212, 436, 57, 46, 221, 5996, 4852, 3829, 2927, 2146, 1486, 947, 529, 232, 56, 265, 8647, 1832, 706, 355, 3487, 142, 1771, 109, 94, 80, 67
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Comments

Examples

			The first twelve rows of the triangle:
    1,
    5,    2,
   13,   16,    4,
   25,   67,   12,    7,
   41,  191,  106,   46,   11,
   61,  436,   80,   31,   23,   16,
   85,  862,  596,  379,  211,   92,   22,
  113, 1541,  302,  781,   59,  277,   38,   29,
  145, 2557, 1954,  193,  991,  631,   58,  154,  37,
  181, 4006,  822, 2416,  467,   96,  212,  436,  57,  46,
  221, 5996, 4852, 3829, 2927, 2146, 1486,  947, 529, 232, 56,
  265, 8647, 1832,  706,  355, 3487,  142, 1771, 109,  94, 80, 67
		

Crossrefs

Cf. A286101.
Cf. A286146 (same triangle reversed).

Programs

  • Python
    from math import lcm, gcd
    def t(n, k): return (2 + ((gcd(n, k) + lcm(n, k))**2) - gcd(n, k) - 3*lcm(n, k))//2
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)][::-1]) # Indranil Ghosh, May 11 2017
  • Scheme
    (define (A286148 n) (A286101bi (A002024 n) (A004736 n))) ;; For A286101bi see A286101.
    
Showing 1-7 of 7 results.