login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345427 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 v. 4
1, 3, 5, 8, 10, 14, 15, 20, 21, 24, 26, 33, 27, 34, 35, 38, 41, 41, 33, 45, 37, 41, 46, 63, 36, 31, 31, 25, 35, 50, 39, 56, 23, 15, 25, 14, -6, 8, -5, -3, -6, 3, -49, 6, -6, -15, -8, -9, -78, -124, -112, -100, -118, -122, -133, -109, -110, -139, -127, -117, -237, -166, -185, -218, -171, -215 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.
LINKS
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, 2]], {x, 1, n}, {y, 1, n}];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 62}] (* Jean-François Alcover, Mar 28 2023 *)
PROG
(Python)
from sympy.core.numbers import igcdex
def A345427(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))) # Chai Wah Wu, Jun 22 2021
CROSSREFS
Sequence in context: A097911 A051611 A258028 * A005004 A006218 A062839
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Jun 22 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 14:38 EDT 2024. Contains 371254 sequences. (Running on oeis4.)