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.

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.

This page as a plain text file.
%I A345424 #19 Mar 29 2023 09:18:48
%S A345424 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,
%T A345424 -30,-18,-30,-16,-52,-64,-56,-70,-91,-70,-78,-90,-94,-84,-137,-87,-99,
%U A345424 -114,-108,-124,-194,-214,-206,-190,-209,-212,-226,-198,-192,-232,-221,-237,-358,-277,-287,-337
%N 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.
%C A345424 Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.
%t A345424 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], #.# &]];
%t A345424 a[n_] := a[n] = Sum[If[GCD[x, y] == 1, T[x, y][[1, 2]], 0], {x, 1, n}, {y, 1, n}];
%t A345424 Table[Print[n, " ", a[n]]; a[n], {n, 1, 64}] (* _Jean-François Alcover_, Mar 28 2023 *)
%o A345424 (Python)
%o A345424 from sympy.core.numbers import igcdex
%o A345424 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
%Y A345424 Cf. A345415-A345428.
%K A345424 sign
%O A345424 1,2
%A A345424 _N. J. A. Sloane_, Jun 22 2021