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

A286153 Square array read by descending antidiagonals A(1,1), A(1,2), A(2,1), ...: 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

2, 11, 13, 7, 5, 8, 22, 8, 7, 26, 16, 38, 9, 42, 19, 37, 47, 58, 62, 52, 43, 29, 23, 48, 14, 51, 25, 34, 56, 30, 39, 19, 16, 41, 33, 64, 46, 80, 31, 25, 20, 23, 32, 88, 53, 79, 93, 108, 32, 41, 39, 31, 116, 102, 89, 67, 57, 94, 140, 33, 27, 30, 148, 101, 63, 76, 106, 68, 81, 157, 176, 34, 29, 184, 166, 87, 75, 118, 92, 138, 69, 175, 158, 216, 35, 224, 165, 185, 74, 150, 103
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Examples

			The top left 1 .. 12 x 1 .. 12 corner of the array:
    2,  11,   7,  22,  16,  37,  29,  56,  46,  79,  67, 106
   13,   5,   8,  38,  47,  23,  30,  80,  93,  57,  68, 138
    8,   7,   9,  58,  48,  39,  31, 108,  94,  81,  69, 174
   26,  42,  62,  14,  19,  25,  32, 140, 157, 175, 194,  82
   19,  52,  51,  16,  20,  41,  33, 176, 158, 215, 195, 110
   43,  25,  41,  23,  39,  27,  34, 216, 237, 177, 196, 142
   34,  33,  32,  31,  30,  29,  35, 260, 238, 217, 197, 178
   64,  88, 116, 148, 184, 224, 268,  44,  53,  63,  74,  86
   53, 102, 101, 166, 165, 246, 245,  46,  54,  87,  75, 114
   89,  63,  87, 185, 225, 183, 223,  57,  81,  65,  76, 146
   76,  75,  74, 205, 204, 203, 202,  69,  68,  67,  77, 182
  118, 150, 186,  86, 114, 146, 182,  82, 110, 142, 178,  90
		

Crossrefs

Array A286151 without its topmost row and leftmost column.

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 + 1], {n, 20}, {k, 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) if n>k else T(n, n^k)
    for n in range(1, 21): print([A(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, May 21 2017
  • Scheme
    (define (A286153 n) (A286151bi (A002260 n) (A004736 n))) ;; For A286151bi see A286151.
    

Formula

A(n,k) = A286151(n,k), for n >= 1, k >= 1.
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).

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

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 19 2020

Keywords

Comments

Restricted growth sequence transform of A286153 (when considered as an one-dimensional sequence), or equally, of A286155.
For all i, j:
a(i) = a(j) => A091255(i) = A091255(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; };
    A001477pairton(a,b) = (((a+b)^2 + 3*a + b)/2);
    A286153sq(n, k) = if(n>k,A001477pairton(bitxor(n,k),k),A001477pairton(n,bitxor(n,k)));
    A286153list(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] = A286153sq(col,(a-(col-1))))); (v); };
    v331305 = rgs_transform(A286153list(up_to));
    A331305(n) = v331305[n]; \\ Antti Karttunen, Jan 19 2020
Showing 1-3 of 3 results.