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

A285733 Transpose of square array A285732.

Original entry on oeis.org

-1, 1, 1, 3, -2, 2, 6, 2, 3, 4, 10, 5, -3, 5, 7, 15, 9, 4, 6, 8, 11, 21, 14, 8, -4, 9, 12, 16, 28, 20, 13, 7, 10, 13, 17, 22, 36, 27, 19, 12, -5, 14, 18, 23, 29, 45, 35, 26, 18, 11, 15, 19, 24, 30, 37, 55, 44, 34, 25, 17, -6, 20, 25, 31, 38, 46, 66, 54, 43, 33, 24, 16, 21, 26, 32, 39, 47, 56, 78, 65, 53, 42, 32, 23, -7, 27, 33, 40, 48, 57, 67
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

See A285732.

Examples

			The top left 9 X 9 corner of the array:
  -1,  1,  3,  6, 10, 15, 21, 28, 36
   1, -2,  2,  5,  9, 14, 20, 27, 35
   2,  3, -3,  4,  8, 13, 19, 26, 34
   4,  5,  6, -4,  7, 12, 18, 25, 33
   7,  8,  9, 10, -5, 11, 17, 24, 32
  11, 12, 13, 14, 15, -6, 16, 23, 31
  16, 17, 18, 19, 20, 21, -7, 22, 30
  22, 23, 24, 25, 26, 27, 28, -8, 29
  29, 30, 31, 32, 33, 34, 35, 36, -9
		

Crossrefs

Transpose: A285732.

Programs

  • Python
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def A(n, k): return -n if n == k else T(n - k, k) if n>k else T(n, k - n)
    for n in range(1, 21): print([A(n - k + 1, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 03 2017
  • Scheme
    (define (A285733 n) (A285732bi (A004736 n) (A002260 n))) ;; For A285732bi see under A285732.
    

Formula

A(n,k) = A285732(k,n) = A285723(n,k) - A286100(n,k).

A331306 Lexicographically earliest infinite sequence such that a(i) = a(j) => A285732(i) = A285732(j) for all i, j.

Original entry on oeis.org

1, 2, 2, 3, 4, 5, 6, 5, 3, 7, 8, 9, 10, 9, 11, 12, 13, 7, 6, 14, 15, 16, 17, 14, 18, 13, 19, 20, 21, 22, 23, 11, 8, 23, 24, 25, 26, 27, 28, 19, 29, 17, 30, 31, 32, 33, 34, 35, 30, 15, 12, 28, 36, 37, 38, 39, 40, 41, 42, 24, 43, 22, 42, 44, 45, 46, 47, 48, 49, 50, 36, 20, 16, 35, 51, 52, 53, 54, 55, 56, 57, 58, 51, 31, 59, 27, 50, 60, 61, 62, 63, 64, 65, 66, 67, 68, 44, 25, 21, 41
Offset: 1

Views

Author

Antti Karttunen, Jan 19 2020

Keywords

Comments

Restricted growth sequence transform of A285732 (when considered as an one-dimensional sequence).
For all i, j:
a(i) = a(j) => A003989(i) = A003989(j),
a(i) = a(j) => A331307(i) = A331307(j) => A072030(i) = A072030(j).

Crossrefs

Programs

  • PARI
    up_to = 25425; \\ = binomial(225+1,2)
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A000027pairton(a,b) = ((2+((a+b)^2 - a) - (3*b))/2);
    A285732sq(n, k) = if(n==k,-n,if(n>k,A000027pairton(n-k,k),A000027pairton(n,k-n)));
    A285732list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A285732sq(col,(a-(col-1))))); (v); };
    v331306 = rgs_transform(A285732list(up_to));
    A331306(n) = v331306[n];

A285721 Square array read by antidiagonals: A(n,k) = number of steps in simple Euclidean algorithm for gcd(n,k) to reach the termination test n=k, read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 2, 2, 3, 4, 1, 0, 1, 4, 5, 3, 3, 3, 3, 5, 6, 2, 3, 0, 3, 2, 6, 7, 4, 1, 4, 4, 1, 4, 7, 8, 3, 4, 2, 0, 2, 4, 3, 8, 9, 5, 4, 4, 5, 5, 4, 4, 5, 9, 10, 4, 2, 1, 4, 0, 4, 1, 2, 4, 10, 11, 6, 5, 5, 4, 6, 6, 4, 5, 5, 6, 11, 12, 5, 5, 3, 5, 3, 0, 3, 5, 3, 5, 5, 12, 13, 7, 3, 5, 1, 2, 7, 7, 2, 1, 5, 3, 7, 13, 14, 6, 6, 2, 6, 3, 5, 0, 5, 3, 6, 2, 6, 6, 14
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Examples

			The top left 18 X 18 corner of the array:
   0, 1, 2, 3, 4, 5, 6, 7, 8,  9, 10, 11, 12, 13, 14, 15, 16, 17
   1, 0, 2, 1, 3, 2, 4, 3, 5,  4,  6,  5,  7,  6,  8,  7,  9,  8
   2, 2, 0, 3, 3, 1, 4, 4, 2,  5,  5,  3,  6,  6,  4,  7,  7,  5
   3, 1, 3, 0, 4, 2, 4, 1, 5,  3,  5,  2,  6,  4,  6,  3,  7,  5
   4, 3, 3, 4, 0, 5, 4, 4, 5,  1,  6,  5,  5,  6,  2,  7,  6,  6
   5, 2, 1, 2, 5, 0, 6, 3, 2,  3,  6,  1,  7,  4,  3,  4,  7,  2
   6, 4, 4, 4, 4, 6, 0, 7, 5,  5,  5,  5,  7,  1,  8,  6,  6,  6
   7, 3, 4, 1, 4, 3, 7, 0, 8,  4,  5,  2,  5,  4,  8,  1,  9,  5
   8, 5, 2, 5, 5, 2, 5, 8, 0,  9,  6,  3,  6,  6,  3,  6,  9,  1
   9, 4, 5, 3, 1, 3, 5, 4, 9,  0, 10,  5,  6,  4,  2,  4,  6,  5
  10, 6, 5, 5, 6, 6, 5, 5, 6, 10,  0, 11,  7,  6,  6,  7,  7,  6
  11, 5, 3, 2, 5, 1, 5, 2, 3,  5, 11,  0, 12,  6,  4,  3,  6,  2
  12, 7, 6, 6, 5, 7, 7, 5, 6,  6,  7, 12,  0, 13,  8,  7,  7,  6
  13, 6, 6, 4, 6, 4, 1, 4, 6,  4,  6,  6, 13,  0, 14,  7,  7,  5
  14, 8, 4, 6, 2, 3, 8, 8, 3,  2,  6,  4,  8, 14,  0, 15,  9,  5
  15, 7, 7, 3, 7, 4, 6, 1, 6,  4,  7,  3,  7,  7, 15,  0, 16,  8
  16, 9, 7, 7, 6, 7, 6, 9, 9,  6,  7,  6,  7,  7,  9, 16,  0, 17
  17, 8, 5, 5, 6, 2, 6, 5, 1,  5,  6,  2,  6,  5,  5,  8, 17,  0
		

Crossrefs

One less than A072030.
Row 2 & column 2: A028242 (but with starting offset 1).
Row 3 & column 3 (from zero onward) seems to be A226576.
Compare also to arrays A049834, A113881, A219158.

Programs

  • Python
    def A(n, k): return 0 if n==k else 1 + A(abs(n - k), min(n, k))
    for n in range(1, 21): print([A(n - k + 1, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 03 2017
  • Scheme
    (define (A285721 n) (A285721bi (A002260 n) (A004736 n)))
    (define (A285721bi row col) (cond ((= row col) 0) ((> row col) (+ 1 (A285721bi (- row col) col))) (else (+ 1 (A285721bi row (- col row))))))
    ;; Alternatively:
    (define (A285721bi row col) (if (= row col) 0 (+ 1 (A285721bi (abs (- row col)) (min col row)))))
    ;; Another implementation, as an one-dimensional sequence:
    (definec (A285721 n) (if (zero? (A285722 n)) 0 (+ 1 (A285721 (A285722 n)))))
    

Formula

If n = k, then A(n,k) = 0, if n > k, then A(n,k) = 1 + A(n-k,k), otherwise [when n < k], A(n,k) = 1 + A(n,k-n).
Or alternatively, when n <> k, A(n,k) = 1 + A(abs(n-k),min(n,k)).
A(n,k) = A072030(n,k)-1.
As an one-dimensional sequence:
a(n) = 0 if A285722(n) = 0, otherwise a(n) = 1 + a(A285722(n)). [Here A285722 is also used as an one-dimensional sequence.]

A285722 Square array A(n,k) read by antidiagonals, A(n,n) = 0, otherwise, if n > k, A(n,k) = T(n-k,k), else A(n,k) = T(n,k-n), where T(n,k) is sequence A000027 considered as a two-dimensional table.

Original entry on oeis.org

0, 1, 1, 2, 0, 3, 4, 3, 2, 6, 7, 5, 0, 5, 10, 11, 8, 6, 4, 9, 15, 16, 12, 9, 0, 8, 14, 21, 22, 17, 13, 10, 7, 13, 20, 28, 29, 23, 18, 14, 0, 12, 19, 27, 36, 37, 30, 24, 19, 15, 11, 18, 26, 35, 45, 46, 38, 31, 25, 20, 0, 17, 25, 34, 44, 55, 56, 47, 39, 32, 26, 21, 16, 24, 33, 43, 54, 66, 67, 57, 48, 40, 33, 27, 0, 23, 32, 42, 53, 65, 78, 79, 68, 58, 49, 41, 34, 28, 22, 31, 41, 52, 64, 77, 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 14 X 14 corner of the array:
   0,  1,  2,  4,  7, 11, 16, 22, 29, 37, 46, 56, 67, 79
   1,  0,  3,  5,  8, 12, 17, 23, 30, 38, 47, 57, 68, 80
   3,  2,  0,  6,  9, 13, 18, 24, 31, 39, 48, 58, 69, 81
   6,  5,  4,  0, 10, 14, 19, 25, 32, 40, 49, 59, 70, 82
  10,  9,  8,  7,  0, 15, 20, 26, 33, 41, 50, 60, 71, 83
  15, 14, 13, 12, 11,  0, 21, 27, 34, 42, 51, 61, 72, 84
  21, 20, 19, 18, 17, 16,  0, 28, 35, 43, 52, 62, 73, 85
  28, 27, 26, 25, 24, 23, 22,  0, 36, 44, 53, 63, 74, 86
  36, 35, 34, 33, 32, 31, 30, 29,  0, 45, 54, 64, 75, 87
  45, 44, 43, 42, 41, 40, 39, 38, 37,  0, 55, 65, 76, 88
  55, 54, 53, 52, 51, 50, 49, 48, 47, 46,  0, 66, 77, 89
  66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56,  0, 78, 90
  78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,  0, 91
  91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79,  0
		

Crossrefs

Transpose: A285723.
Cf. A000124 (row 1, from 1 onward), A000217 (column 1).

Programs

  • Mathematica
    A[n_, n_] = 0;
    A[n_, k_] /; k == n-1 := (k^2 - k + 2)/2;
    A[1, k_] := (k^2 - 3k + 4)/2;
    A[n_, k_] /; 1 <= k <= n-2 := A[n, k] = A[n, k+1] + 1;
    A[n_, k_] /; k > n := A[n, k] = A[n-1, k] + 1;
    Table[A[n-k+1, k], {n, 1, 14}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 19 2019 *)
  • Python
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def A(n, k): return 0 if n == k else T(n - k, k) if n>k else T(n, k - n)
    for n in range(1, 21): print([A(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, May 03 2017
  • Scheme
    (define (A285722 n) (A285722bi (A002260 n) (A004736 n)))
    (define (A285722bi row col) (cond ((= row col) 0) ((> row col) (A000027bi (- row col) col)) (else (A000027bi row (- col row)))))
    (define (A000027bi row col) (* (/ 1 2) (+ (expt (+ row col) 2) (- row) (- (* 3 col)) 2)))
    

Formula

If n = k, A(n,k) = 0, if n > k, A(n,k) = T(n-k,k), otherwise [when n < k], A(n,k) = T(n,k-n), 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.

A286101 Square array A(n,k) read by antidiagonals: 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, 2, 4, 5, 4, 7, 16, 16, 7, 11, 12, 13, 12, 11, 16, 46, 67, 67, 46, 16, 22, 23, 106, 25, 106, 23, 22, 29, 92, 31, 191, 191, 31, 92, 29, 37, 38, 211, 80, 41, 80, 211, 38, 37, 46, 154, 277, 379, 436, 436, 379, 277, 154, 46, 56, 57, 58, 59, 596, 61, 596, 59, 58, 57, 56, 67, 232, 436, 631, 781, 862, 862, 781, 631, 436, 232, 67, 79, 80, 529, 212, 991, 302, 85, 302, 991, 212, 529, 80, 79
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
   2,   5,  16,  12,   46,   23,   92,   38,  154,   57,  232,   80
   4,  16,  13,  67,  106,   31,  211,  277,   58,  436,  529,   94
   7,  12,  67,  25,  191,   80,  379,   59,  631,  212,  947,  109
  11,  46, 106, 191,   41,  436,  596,  781,  991,   96, 1486, 1771
  16,  23,  31,  80,  436,   61,  862,  302,  193,  467, 2146,  142
  22,  92, 211, 379,  596,  862,   85, 1541, 1954, 2416, 2927, 3487
  29,  38, 277,  59,  781,  302, 1541,  113, 2557,  822, 3829,  355
  37, 154,  58, 631,  991,  193, 1954, 2557,  145, 4006, 4852,  706
  46,  57, 436, 212,   96,  467, 2416,  822, 4006,  181, 5996, 1832
  56, 232, 529, 947, 1486, 2146, 2927, 3829, 4852, 5996,  221, 8647
  67,  80,  94, 109, 1771,  142, 3487,  355,  706, 1832, 8647,  265
		

Crossrefs

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

Programs

Formula

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.
A(n,k) = A(k,n), or equivalently, a(A038722(n)) = a(n). [Array is symmetric.]

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

A286100 Square array A(n,k): If n = k, then A(n,k) = n, otherwise 0, read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Examples

			The top left 9 X 9 corner of the array:
  1, 0, 0, 0, 0, 0, 0, 0, 0
  0, 2, 0, 0, 0, 0, 0, 0, 0
  0, 0, 3, 0, 0, 0, 0, 0, 0
  0, 0, 0, 4, 0, 0, 0, 0, 0
  0, 0, 0, 0, 5, 0, 0, 0, 0
  0, 0, 0, 0, 0, 6, 0, 0, 0
  0, 0, 0, 0, 0, 0, 7, 0, 0
  0, 0, 0, 0, 0, 0, 0, 8, 0
  0, 0, 0, 0, 0, 0, 0, 0, 9
		

Crossrefs

Cf. A000027 (the main diagonal).
Cf. also arrays A003982, A285732.

Programs

  • Mathematica
    Table[Function[s, If[OddQ@ Length@ s, ReplacePart[s, {# -> #}] &[Ceiling[n/2]], s]]@ ConstantArray[0, n], {n, 15}] // Flatten (* Michael De Vlieger, May 04 2017 *)
  • Python
    def A(n, k): return n if n==k else 0
    for n in range(1, 21): print( [A(k, n - k + 1) for k in range(1, n + 1)] ) # Indranil Ghosh, May 03 2017
  • Scheme
    (define (A286100 n) (A286100bi (A002260 n) (A004736 n)))
    (define (A286100bi row col) (if (= row col) row 0))
    

Formula

If n = k, then A(n,k) = n, otherwise 0.

A286155 Square array A(n,k) read by antidiagonals, A(n,n) = -n, otherwise, if n > k, A(n,k) = T(n XOR k,k), else A(n,k) = T(n,n XOR k), where T(n,k) is sequence A000027 considered as a two-dimensional table and XOR is bitwise-xor (A003987).

Original entry on oeis.org

-1, 4, 6, 2, -2, 3, 11, 3, 2, 15, 7, 23, -3, 27, 10, 22, 30, 39, 43, 35, 28, 16, 12, 31, -4, 34, 14, 21, 37, 17, 24, 10, 7, 26, 20, 45, 29, 57, 18, 14, -5, 12, 19, 65, 36, 56, 68, 81, 19, 26, 24, 18, 89, 77, 66, 46, 38, 69, 109, 20, -6, 17, 117, 76, 44, 55, 79, 47, 58, 124, 141, 21, 16, 149, 133, 64, 54, 91, 67, 107, 48, 140, 125, 177, -7, 185, 132, 150, 53, 119
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 1 .. 12 x 1 .. 12 corner of the array:
  -1,   4,   2,  11,   7,  22,  16,  37,  29,  56,  46,  79
   6,  -2,   3,  23,  30,  12,  17,  57,  68,  38,  47, 107
   3,   2,  -3,  39,  31,  24,  18,  81,  69,  58,  48, 139
  15,  27,  43,  -4,  10,  14,  19, 109, 124, 140, 157,  59
  10,  35,  34,   7,  -5,  26,  20, 141, 125, 176, 158,  83
  28,  14,  26,  12,  24,  -6,  21, 177, 196, 142, 159, 111
  21,  20,  19,  18,  17,  16,  -7, 217, 197, 178, 160, 143
  45,  65,  89, 117, 149, 185, 225,  -8,  36,  44,  53,  63
  36,  77,  76, 133, 132, 205, 204,  29,  -9,  64,  54,  87
  66,  44,  64, 150, 186, 148, 184,  38,  58, -10,  55, 115
  55,  54,  53, 168, 167, 166, 165,  48,  47,  46, -11, 147
  91, 119, 151,  63,  87, 115, 147,  59,  83, 111, 143, -12
		

Crossrefs

Cf. also arrays A285732, A286151, A286153.

Programs

Formula

If n = k, A(n,k) = -n, if n > k, A(n,k) = T(A003987(n,k),k), otherwise [when n < k], A(n,k) = T(n,A003987(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.
Showing 1-8 of 8 results.