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.

Previous Showing 11-18 of 18 results.

A345424 For 1<=x<=n, 1<=y<=n, with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of v.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 6, 8, 7, 7, 8, 10, 3, 8, 6, 4, 6, 3, -6, 2, -8, -7, -3, 5, -24, -24, -25, -39, -30, -18, -30, -16, -52, -64, -56, -70, -91, -70, -78, -90, -94, -84, -137, -87, -99, -114, -108, -124, -194, -214, -206, -190, -209, -212, -226, -198, -192, -232, -221, -237, -358, -277, -287, -337
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.

Crossrefs

Programs

  • Mathematica
    T[x_, y_] := T[x, y] = Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= x^2 + y^2 && u*x + v*y == 1, {u, v}, Integers], #.# &]];
    a[n_] := a[n] = Sum[If[GCD[x, y] == 1, T[x, y][[1, 2]], 0], {x, 1, n}, {y, 1, n}];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 64}] (* Jean-François Alcover, Mar 28 2023 *)
  • Python
    from sympy.core.numbers import igcdex
    def A345424(n): return sum(v for u, v, w in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if w == 1) # Chai Wah Wu, Jun 22 2021

A345425 For 1<=x<=n, 1<=y<=n, with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of u+v.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 11, 15, 13, 13, 15, 19, 5, 15, 11, 7, 11, 5, -13, 3, -17, -15, -7, 9, -49, -49, -51, -79, -61, -37, -61, -33, -105, -129, -113, -141, -183, -141, -157, -181, -189, -169, -275, -175, -199, -229, -217, -249, -389, -429, -413, -381, -419, -425, -453, -397
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.

Crossrefs

Programs

  • Mathematica
    T[x_, y_] := T[x, y] = Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= x^2 + y^2 && u*x + v*y == 1, {u, v}, Integers], #.# &]];
    a[n_] := a[n] = Sum[If[GCD[x, y] == 1, T[x, y][[1]] // Total, 0], {x, 1, n}, {y, 1, n}];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 56}] (* Jean-François Alcover, Mar 28 2023 *)
  • Python
    from sympy.core.numbers import igcdex
    def A345425(n): return sum(u+v for u, v, w in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if w == 1) # Chai Wah Wu, Jun 24 2021

A345426 For 1<=x<=n, 1<=y<=n, write gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of u.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 8, 12, 12, 14, 15, 21, 14, 20, 20, 22, 24, 23, 14, 25, 16, 19, 23, 39, 11, 5, 4, -3, 6, 20, 8, 24, -10, -19, -10, -22, -43, -30, -44, -43, -47, -39, -92, -38, -51, -61, -55, -57, -127, -174, -163, -152, -171, -176, -188, -165, -167, -197, -186, -177, -298, -228
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.

Crossrefs

Programs

  • Mathematica
    T[x_, y_] := T[x, y] = Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= x^2 + y^2 && u*x + v*y == GCD[x, y], {u, v}, Integers], #.# &]];
    a[n_] := a[n] = Sum[T[x, y][[1, 1]], {x, 1, n}, {y, 1, n}];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 62}] (* Jean-François Alcover, Mar 28 2023 *)
  • Python
    from sympy.core.numbers import igcdex
    def A345426(n): return sum(u for u, v, w in (igcdex(x, y) for x in range(1, n+1) for y in range(1, n+1))) # Chai Wah Wu, Jul 01 2021

A345430 For 1<=x<=n, 1<=y<=n, with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of |v|.

Original entry on oeis.org

1, 2, 5, 8, 17, 20, 38, 50, 71, 83, 128, 146, 209, 236, 278, 326, 434, 473, 608, 668, 758, 833, 1031, 1103, 1292, 1400, 1583, 1709, 2024, 2120, 2480, 2672, 2912, 3104, 3410, 3572, 4085, 4328, 4670, 4910, 5540, 5738, 6431, 6761, 7163, 7526, 8354, 8642, 9416, 9788, 10388
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    def A345430(n): return sum(abs(v) for u, v, w in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if w == 1) # Chai Wah Wu, Jun 22 2021

A345431 For 1<=x<=n, 1<=y<=n, with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of u^2+v^2.

Original entry on oeis.org

1, 3, 9, 15, 41, 47, 119, 171, 281, 333, 623, 755, 1233, 1419, 1799, 2231, 3319, 3705, 5215, 5943, 7075, 7953, 10665, 11665, 14467, 15983, 18949, 21081, 26479, 28239, 34803, 38403, 43203, 46779, 53215, 56555, 67885, 73115, 81015, 86711, 101891, 106999, 124753, 133461, 144273
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    def A345431(n): return sum(u**2+v**2 for u, v, w in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if w == 1) # Chai Wah Wu, Jun 22 2021

A345432 For 1<=x<=n, 1<=y<=n, write gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of |u|.

Original entry on oeis.org

0, 1, 4, 8, 17, 24, 42, 58, 82, 104, 149, 177, 240, 286, 340, 404, 512, 579, 714, 799, 910, 1031, 1229, 1341, 1539, 1711, 1918, 2093, 2408, 2574, 2934, 3190, 3478, 3779, 4112, 4362, 4875, 5254, 5662, 5999, 6629, 6969, 7662, 8116, 8593, 9155, 9983, 10431, 11223, 11806
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.

Crossrefs

Programs

  • Python
    from sympy.core.numbers import igcdex
    def A345432(n): return sum(abs(u) for u, v, w in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1))) # Chai Wah Wu, Jun 22 2021

A345429 For 1<=x<=n, 1<=y<=n, with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of |u|.

Original entry on oeis.org

0, 1, 4, 7, 16, 19, 37, 49, 70, 82, 127, 145, 208, 235, 277, 325, 433, 472, 607, 667, 757, 832, 1030, 1102, 1291, 1399, 1582, 1708, 2023, 2119, 2479, 2671, 2911, 3103, 3409, 3571, 4084, 4327, 4669, 4909, 5539, 5737, 6430, 6760, 7162, 7525, 8353, 8641, 9415, 9787
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2021

Keywords

Comments

Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.
It would be nice to have b-files for this and related sequences (as listed in cross-references). The present sequence is especially interesting. What is its rate of growth?

Crossrefs

Programs

  • Maple
    mygcd:=proc(a,b) local d,s,t; d := igcdex(a,b,`s`,`t`); [a,b,d,s,t]; end;
    ansu:=[]; ansv:=[]; ansb:=[];
    for N from 1 to 80 do
    tu:=0; tv:=0; tb:=0;
    for x from 1 to N do
    for y from 1 to N do
    if igcd(x,y)=1 then
       tu:=tu+abs(mygcd(x,y)[4]);
       tv:=tv+abs(mygcd(x,y)[5]);
       tb:=tb+mygcd(x,y)[4]^2 + mygcd(x,y)[5]^2;
    fi;
    od: od:
    ansu:=[op(ansu),tu];
    ansv:=[op(ansv),tv];
    ansb:=[op(ansb),tb];
    od:
    ansu; # the present sequence
    ansv; # A345430
    ansb; # A345431
    # for A345432, A345433, A345434, omit the "igcd(x,y)=1" test
  • Python
    from sympy.core.numbers import igcdex
    def A345429(n): return sum(abs(u) for u, v, w in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if w == 1) # Chai Wah Wu, Jun 22 2021

A347735 Square array T(n, k), n, k > 0, read by antidiagonals; let b be the function that associates to any pair of integers (u, v) the Bézout coefficients (x, y) as produced by the extended Euclidean algorithm (u*x + v*y = gcd(u, v)); T(n, k) is the number of iterations of b when starting from (n, k) needed to obtain a unit vector.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1
Offset: 1

Views

Author

Rémy Sigrist, Sep 11 2021

Keywords

Comments

For n, k > 0, b(n, k) = (A345415(n, k), A345416(n, k)).

Examples

			Array T(n, k) begins:
  n\k|  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
  ---+---------------------------------------------------
    1|  1  1  1  1  1  1  1  1  1   1   1   1   1   1   1
    2|  1  1  2  1  2  1  2  1  2   1   2   1   2   1   2
    3|  1  2  1  2  2  1  2  2  1   2   2   1   2   2   1
    4|  1  1  2  1  2  2  2  1  2   2   2   1   2   2   2
    5|  1  2  2  2  1  2  3  3  2   1   2   3   3   2   1
    6|  1  1  1  2  2  1  2  2  2   2   2   1   2   2   2
    7|  1  2  2  2  3  2  1  2  3   3   3   3   2   1   2
    8|  1  1  2  1  3  2  2  1  2   2   3   2   3   2   2
    9|  1  2  1  2  2  2  3  2  1   2   3   2   3   3   2
   10|  1  1  2  2  1  2  3  2  2   1   2   2   3   3   2
		

Crossrefs

Programs

  • PARI
    T(n,k) = { for (v=0, oo, if (n^2+k^2<=1, return (v), [n,k]=gcdext(n,k)[1..2])) }

Formula

T(n, k) = T(k, n).
T(n, n) = 1.
T(m*n, m*k) = T(n, k) for any m > 0.
Previous Showing 11-18 of 18 results.