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-2 of 2 results.

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

A345696 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) = m^2*s, where s is the population variance of the values of u^2+v^2 and m is the number of such values.

Original entry on oeis.org

0, 0, 10, 28, 846, 1080, 13524, 28336, 101274, 130086, 526116, 796704, 2121646, 2676676, 5103216, 7545320, 16863936, 20080798, 39983568, 51986376, 78689204, 96323998, 175534714, 207346098, 324942572, 386288432, 560665370, 693425934, 1087095852, 1220707044
Offset: 1

Views

Author

Chai Wah Wu, Jun 24 2021

Keywords

Comments

The factor m^2 is to ensure that a(n) is an integer.
A345431(n) = m*mu where mu is the mean of the values of u^2+v^2.
s^(1/4) appears to grow linearly with n.

Crossrefs

Programs

  • Python
    from statistics import pvariance
    from sympy.core.numbers import igcdex
    def A345696(n):
        zlist = [z for z in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if z[2] == 1]
        return pvariance(len(zlist)*(u**2+v**2) for u, v, w in zlist)
Showing 1-2 of 2 results.