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

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

A091255 Square array computed from gcd(P(x),P(y)) where P(x) and P(y) are polynomials with coefficients in {0,1} given by the binary expansions of x and y, and the polynomial calculation is done over GF(2), with the result converted back to a binary number, and then expressed in decimal. Array is symmetric, and is read by falling antidiagonals.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 03 2004

Keywords

Comments

Array is read by antidiagonals, with (x,y) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), ...
Analogous to A003989.
"Coded in binary" means that a polynomial a(n)*X^n+...+a(0)*X^0 over GF(2) is represented by the binary number a(n)*2^n+...+a(0)*2^0 in Z (where a(k)=0 or 1).

Examples

			The top left 17 X 17 corner of the array:
      1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
    +---------------------------------------------------------------
   1: 1, 1, 1, 1, 1, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1,  1,  1, ...
   2: 1, 2, 1, 2, 1, 2, 1, 2, 1,  2,  1,  2,  1,  2,  1,  2,  1, ...
   3: 1, 1, 3, 1, 3, 3, 1, 1, 3,  3,  1,  3,  1,  1,  3,  1,  3, ...
   4: 1, 2, 1, 4, 1, 2, 1, 4, 1,  2,  1,  4,  1,  2,  1,  4,  1, ...
   5: 1, 1, 3, 1, 5, 3, 1, 1, 3,  5,  1,  3,  1,  1,  5,  1,  5, ...
   6: 1, 2, 3, 2, 3, 6, 1, 2, 3,  6,  1,  6,  1,  2,  3,  2,  3, ...
   7: 1, 1, 1, 1, 1, 1, 7, 1, 7,  1,  1,  1,  1,  7,  1,  1,  1, ...
   8: 1, 2, 1, 4, 1, 2, 1, 8, 1,  2,  1,  4,  1,  2,  1,  8,  1, ...
   9: 1, 1, 3, 1, 3, 3, 7, 1, 9,  3,  1,  3,  1,  7,  3,  1,  3, ...
  10: 1, 2, 3, 2, 5, 6, 1, 2, 3, 10,  1,  6,  1,  2,  5,  2,  5, ...
  11: 1, 1, 1, 1, 1, 1, 1, 1, 1,  1, 11,  1,  1,  1,  1,  1,  1, ...
  12: 1, 2, 3, 4, 3, 6, 1, 4, 3,  6,  1, 12,  1,  2,  3,  4,  3, ...
  13: 1, 1, 1, 1, 1, 1, 1, 1, 1,  1,  1,  1, 13,  1,  1,  1,  1, ...
  14: 1, 2, 1, 2, 1, 2, 7, 2, 7,  2,  1,  2,  1, 14,  1,  2,  1, ...
  15: 1, 1, 3, 1, 5, 3, 1, 1, 3,  5,  1,  3,  1,  1, 15,  1, 15, ...
  16: 1, 2, 1, 4, 1, 2, 1, 8, 1,  2,  1,  4,  1,  2,  1, 16,  1, ...
  17: 1, 1, 3, 1, 5, 3, 1, 1, 3,  5,  1,  3,  1,  1,  15, 1, 17, ...
  ...
3, which is "11" in binary, encodes polynomial X + 1, while 7 ("111" in binary) encodes polynomial X^2 + X + 1, whereas 9 ("1001" in binary), encodes polynomial X^3 + 1. Now (X + 1)(X^2 + X + 1) = (X^3 + 1) when the polynomials are multiplied over GF(2), or equally, when multiplication of integers 3 and 7 is done as a carryless base-2 product (A048720(3,7) = 9). Thus it follows that A(3,9) = A(9,3) = 3 and A(7,9) = A(9,7) = 7.
Furthermore, 5 ("101" in binary) encodes polynomial X^2 + 1 which is equal to (X + 1)(X + 1) in GF(2)[X], thus A(5,9) = A(9,5) = 3, as the irreducible polynomial (X + 1) is the only common factor for polynomials X^2 + 1 and X^3 + 1.
		

Crossrefs

Cf. also A327856 (the upper left triangular section of this array), A327857.

Programs

  • PARI
    A091255sq(a,b) = fromdigits(Vec(lift(gcd(Pol(binary(a))*Mod(1, 2),Pol(binary(b))*Mod(1, 2)))),2); \\ Antti Karttunen, Aug 12 2019

Formula

A(x,y) = A(y,x) = A(x, A003987(x,y)) = A(A003987(x,y), y), where A003987 gives the bitwise-XOR of its two arguments. - Antti Karttunen, Sep 28 2019

Extensions

Data section extended up to a(105), examples added by Antti Karttunen, Sep 28 2019

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

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