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!)
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. 3
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 (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 == 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 *)
PROG
(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
CROSSREFS
Sequence in context: A103701 A206544 A122799 * A362022 A162495 A107315
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 April 25 11:39 EDT 2024. Contains 371969 sequences. (Running on oeis4.)