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.

A345422 Row 5 of array in A345417.

Original entry on oeis.org

1, -1, 1, 2, 0, 6, -3, 7, -2, 8, -14, -10, 15, 4, -17, -24, -16, -11, -6, 13, 20, 36, -15, -8, -44, 46, -28, 39, 10, -41, -23, 12, 25, 38, -27, 55, -57, -74, 76, 63, -65, 33, -52, -35, 18, -18, 96, -81, 62, -104, 106, 87, 22, -114, -70, 24, 49, 74, 126, -51, 103, 80, 28, -113, 57
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    from sympy import prime
    def A345422(n): return igcdex(11, prime(n))[0] # Chai Wah Wu, Jul 01 2021

A345419 Row 2 of array in A345417.

Original entry on oeis.org

1, 0, 2, -2, 4, -4, 6, -6, 8, 10, -10, -12, 14, -14, 16, 18, 20, -20, -22, 24, -24, -26, 28, 30, -32, 34, -34, 36, -36, 38, -42, 44, 46, -46, 50, -50, -52, -54, 56, 58, 60, -60, 64, -64, 66, -66, -70, -74, 76, -76, 78, 80, -80, 84, 86, 88, 90, -90, -92, 94, -94, 98, -102, 104, -104
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    from sympy import prime
    def A345419(n): return igcdex(3, prime(n))[0] # Chai Wah Wu, Jul 01 2021

A345421 Row 4 of array in A345417.

Original entry on oeis.org

1, 1, -2, 0, -3, 2, 5, -8, 10, -4, 9, 16, 6, -6, -20, -15, 17, -26, -19, -10, 21, 34, 12, -38, 14, 29, -44, 46, -31, -16, -18, -56, -39, 20, 64, -43, 45, 70, 24, -74, -51, 26, 82, -55, -28, 57, -30, 32, 65, -98, 100, -34, 69, 36, -110, -75, 77, -116, -79, -40, 81, 42, 44, 89
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    from sympy import prime
    def A345421(n): return igcdex(7, prime(n))[0] # Chai Wah Wu, Jul 01 2021

A345420 Row 3 of array in A345417.

Original entry on oeis.org

1, -1, 0, 3, -2, -5, 7, 4, -9, 6, -6, 15, -8, -17, 19, -21, 12, -12, 27, -14, -29, 16, -33, 18, 39, -20, -41, 43, 22, -45, 51, -26, 55, 28, 30, -30, 63, -65, 67, -69, 36, -36, -38, -77, 79, 40, -42, -89, 91, 46, -93, 48, -48, -50, 103, -105, 54, -54, 111, -56, -113, -117, 123, -62
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    from sympy import prime
    def A345420(n): return igcdex(5, prime(n))[0] # Chai Wah Wu, Jul 01 2021

A345415 Table read by upward antidiagonals: Given m, n >= 1, write gcd(m,n) as d = u*m+v*n where u, v are minimal; T(m,n) = u.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 1, -1, 1, 0, 0, 0, 1, 1, 0, 1, 1, -1, -2, 1, 0, 0, -1, 0, 2, 1, 1, 0, 1, 0, 1, -1, 1, -3, 1, 0, 0, 1, 1, 0, -1, -2, 1, 1, 0, 1, -1, -1, 1, -1, 2, 3, -4, 1, 0, 0, 0, 0, -2, 0, 3, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, -1, -3, -2, -3, -5, 1, 0, 0, -1, 1, -1, 1, 0, -1, 2, -2, 4, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Comments

The gcd is given in A003989, and v is given in A345416. Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when m=n. If we ignore the diagonal, the v table is the transpose of the u table.

Examples

			The gcd table (A003989) begins:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 2, 1, 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3, -1, -3]
[0, 1, -1, -1, 1, -1, 2, 3, -4, 1, 0, -1, 6, -5, -4, 3]
[0, 0, 0, 0, -2, 0, 3, 1, 1, 1, 1, 0, -1, -1, -1, -1]
...
The v table (A345416) begins:
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
[1, -1, 1, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1]
[1, 1, -1, 1, 1, 1, -1, 0, 1, 1, -1, 0, 1, 1, -1, 0]
[1, -2, 2, -1, 1, 1, -2, 2, -1, 0, 1, -2, 2, -1, 0, 1]
[1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 0, 1, 1, 1, -1]
[1, -3, -2, 2, 3, -1, 1, 1, -3, -2, 2, 3, -1, 0, 1, -3]
[1, 1, 3, 1, -3, -1, -1, 1, 1, 1, 3, 1, -3, -1, -1, 0]
[1, -4, 1, -2, 2, -1, 4, -1, 1, 1, -4, 1, -2, 2, -1, 4]
[1, 1, -3, -2, 1, 2, 3, -1, -1, 1, 1, 1, -3, -2, 1, 2]
[1, -5, 4, 3, -2, 2, -3, -4, 5, -1, 1, 1, -5, 4, 3, -2]
[1, 1, 1, 1, 5, 1, -5, -1, -1, -1, -1, 1, 1, 1, 1, 1]
...
		

Crossrefs

Programs

  • Maple
    mygcd:=proc(a,b) local d,s,t; d := igcdex(a,b,`s`,`t`); [a,b,d,s,t]; end;
    gcd_rowu:=(m,M)->[seq(mygcd(m,n)[4],n=1..M)];
    for m from 1 to 12 do lprint(gcd_rowu(m,16)); od;
  • Mathematica
    T[m_, n_] := Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= 26 && u*m + v*n == GCD[m, n], {u, v}, Integers], #.#&][[1, 1]]];
    Table[T[m - n + 1, n], {m, 1, 13}, {n, 1, m}] // Flatten (* Jean-François Alcover, Mar 27 2023 *)

A345416 Table read by upward antidiagonals: Given m, n >= 1, write gcd(m,n) as d = u*m+v*n where u, v are minimal; T(m,n) = v.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, -1, 1, 0, 1, 1, 1, 0, 0, 1, -2, -1, 1, 1, 0, 1, 1, 2, 1, -1, 0, 0, 1, -3, 1, -1, 1, 0, 1, 0, 1, 1, -2, -1, 1, 1, 1, 0, 0, 1, -4, 3, 2, -1, 1, -1, -1, 1, 0, 1, 1, 1, 1, 3, 1, -2, 0, 0, 0, 0, 1, -5, -3, -2, -3, -1, 1, 2, 1, 1, 1, 0, 1, 1, 4, -2, 2, -1, 1, 1, -1, 1, -1, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Comments

The gcd is given in A003989, and u is given in A345415. Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when m=n. If we ignore the diagonal, the v table is the transpose of the u table.

Examples

			The gcd table (A003989) begins:
[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, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1]
[1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4]
[1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1]
[1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2]
[1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 1, 1]
[1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 8]
[1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1]
[1, 2, 1, 2, 5, 2, 1, 2, 1, 10, 1, 2, 1, 2, 5, 2]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1]
[1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4]
...
The u table (A345415) begins:
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[0, 0, -1, 1, -2, 1, -3, 1, -4, 1, -5, 1, -6, 1, -7, 1]
[0, 1, 0, -1, 2, 1, -2, 3, 1, -3, 4, 1, -4, 5, 1, -5]
[0, 0, 1, 0, -1, -1, 2, 1, -2, -2, 3, 1, -3, -3, 4, 1]
[0, 1, -1, 1, 0, -1, 3, -3, 2, 1, -2, 5, -5, 3, 1, -3]
[0, 0, 0, 1, 1, 0, -1, -1, -1, 2, 2, 1, -2, -2, -2, 3]
[0, 1, 1, -1, -2, 1, 0, -1, 4, 3, -3, -5, 2, 1, -2, 7]
[0, 0, -1, 0, 2, 1, 1, 0, -1, -1, -4, -1, 5, 2, 2, 1]
[0, 1, 0, 1, -1, 1, -3, 1, 0, -1, 5, -1, 3, -3, 2, -7]
[0, 0, 1, 1, 0, -1, -2, 1, 1, 0, -1, -1, 4, 3, -1, -3]
[0, 1, -1, -1, 1, -1, 2, 3, -4, 1, 0, -1, 6, -5, -4, 3]
[0, 0, 0, 0, -2, 0, 3, 1, 1, 1, 1, 0, -1, -1, -1, -1]
...
The v table (this entry) begins:
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
[1, -1, 1, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1]
[1, 1, -1, 1, 1, 1, -1, 0, 1, 1, -1, 0, 1, 1, -1, 0]
[1, -2, 2, -1, 1, 1, -2, 2, -1, 0, 1, -2, 2, -1, 0, 1]
[1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 0, 1, 1, 1, -1]
[1, -3, -2, 2, 3, -1, 1, 1, -3, -2, 2, 3, -1, 0, 1, -3]
[1, 1, 3, 1, -3, -1, -1, 1, 1, 1, 3, 1, -3, -1, -1, 0]
[1, -4, 1, -2, 2, -1, 4, -1, 1, 1, -4, 1, -2, 2, -1, 4]
[1, 1, -3, -2, 1, 2, 3, -1, -1, 1, 1, 1, -3, -2, 1, 2]
[1, -5, 4, 3, -2, 2, -3, -4, 5, -1, 1, 1, -5, 4, 3, -2]
[1, 1, 1, 1, 5, 1, -5, -1, -1, -1, -1, 1, 1, 1, 1, 1]
...
		

Crossrefs

Programs

  • Maple
    mygcd:=proc(a,b) local d,s,t; d := igcdex(a,b,`s`,`t`); [a,b,d,s,t]; end;
    gcd_rowv:=(m,M)->[seq(mygcd(m,n)[5],n=1..M)];
    for m from 1 to 12 do lprint(gcd_rowv(m,16)); od;
  • Mathematica
    T[m_, n_] := Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= 26 && u*m + v*n == GCD[m, n], {u, v}, Integers], #.#&][[1, 2]]];
    Table[T[m - n + 1, n], {m, 1, 13}, {n, 1, m}] // Flatten (* Jean-François Alcover, Mar 27 2023 *)

A345418 Table read by upward antidiagonals: Given m, n >= 1, write gcd(prime(m),prime(n)) as d = u*prime(m)+v*prime(n) where u, v are minimal; T(m,n) = v.

Original entry on oeis.org

1, -1, 1, -2, 1, 1, -3, 2, -1, 1, -5, -2, 1, 1, 1, -6, 4, 3, -2, -1, 1, -8, -4, -2, 1, 1, 1, 1, -9, 6, -5, -3, 2, 2, -1, 1, -11, -6, 7, 2, 1, -1, -2, 1, 1, -14, 8, 4, 5, 6, -5, -2, -1, -1, 1, -15, 10, -9, -8, -3, 1, 2, 3, 2, -1, 1, -18, -10, 6, 10, 7, 4, -3, -4, -3, -1, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Comments

The gcd is 1 unless m=n when it is m; u is given in A345417. Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when m=n. If we ignore the diagonal, the v table is the transpose of the u table.

Examples

			The u table (A345417) begins:
[0, -1, -2, -3, -5, -6, -8, -9, -11, -14, -15, -18, -20, -21, -23, -26]
[1,  0,  2, -2,  4, -4,  6, -6,   8,  10, -10, -12,  14, -14,  16,  18]
[1, -1,  0,  3, -2, -5,  7,  4,  -9,   6,  -6,  15,  -8, -17,  19, -21]
[1,  1, -2,  0, -3,  2,  5, -8,  10,  -4,   9,  16,   6,  -6, -20, -15]
[1, -1,  1,  2,  0,  6, -3,  7,  -2,   8, -14, -10,  15,   4, -17, -24]
[1,  1,  2, -1, -5,  0,  4,  3,  -7,   9,  12, -17,  19,  10, -18,  -4]
[1, -1, -2, -2,  2, -3,  0,  9,  -4,  12,  11, -13, -12,  -5, -11,  25]
[1,  1, -1,  3, -4, -2, -8,  0,  -6,  -3, -13,   2,  13,  -9,   5,  14]
[1, -1,  2, -3,  1,  4,  3,  5,   0,  -5,  -4,  -8, -16,  15,  -2, -23]
[1, -1, -1,  1, -3, -4, -7,  2,   4,   0,  15, -14,  17,   3,  13,  11]
[1,  1,  1, -2,  5, -5, -6,  8,   3, -14,   0,   6,   4, -18,  -3,  12]
[1,  1, -2, -3,  3,  6,  6, -1,   5,  11,  -5,   0,  10,   7,  14, -10]
...
The v table (this entry) begins:
[  1,   1,  1,  1,   1,   1,   1,   1,  1,   1,   1,  1,   1,  1,   1,  1]
[ -1,   1, -1,  1,  -1,   1,  -1,   1, -1,  -1,   1,  1,  -1,  1,  -1, -1]
[ -2,   2,  1, -2,   1,   2,  -2,  -1,  2,  -1,   1, -2,   1,  2,  -2,  2]
[ -3,  -2,  3,  1,   2,  -1,  -2,   3, -3,   1,  -2, -3,  -1,  1,   3,  2]
[ -5,   4, -2, -3,   1,  -5,   2,  -4,  1,  -3,   5,  3,  -4, -1,   4,  5]
[ -6,  -4, -5,  2,   6,   1,  -3,  -2,  4,  -4,  -5,  6,  -6, -3,   5,  1]
[ -8,   6,  7,  5,  -3,   4,   1,  -8,  3,  -7,  -6,  6,   5,  2,   4, -8]
[ -9,  -6,  4, -8,   7,   3,   9,   1,  5,   2,   8, -1,  -6,  4,  -2, -5]
[-11,   8, -9, 10,  -2,  -7,  -4,  -6,  1,   4,   3,  5,   9, -8,   1, 10]
[-14,  10,  6, -4,   8,   9,  12,  -3, -5,   1, -14, 11, -12, -2,  -8, -6]
[-15, -10, -6,  9, -14,  12,  11, -13, -4,  15,   1, -5,  -3, 13,   2, -7]
[-18, -12, 15, 16, -10, -17, -13,   2, -8, -14,   6,  1,  -9, -6, -11,  7]
...
		

Crossrefs

Showing 1-7 of 7 results.