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.

A347683 Triangle read by rows: T(n,k) (1<=k<=n) = f(n,k), where f(x,y) = x*red_inv(x,y) + y*red_inv(y,x) if gcd(x,y)=1, or 0 if gcd(x,y)>1, and red_inv is defined in the comments.

This page as a plain text file.
%I A347683 #21 Dec 10 2023 17:15:45
%S A347683 0,1,0,1,5,0,1,0,7,0,1,9,11,9,0,1,0,0,0,11,0,1,13,13,15,29,13,0,1,0,
%T A347683 17,0,31,0,15,0,1,17,0,17,19,0,55,17,0,1,0,19,0,0,0,41,0,19,0,1,21,23,
%U A347683 23,21,23,43,65,89,21,0,1,0,0,0,49,0,71,0,0,0,23,0,1,25,25,25,51,25,27,79,53,79,131,25,0
%N A347683 Triangle read by rows: T(n,k) (1<=k<=n) = f(n,k), where f(x,y) = x*red_inv(x,y) + y*red_inv(y,x) if gcd(x,y)=1, or 0 if gcd(x,y)>1, and red_inv is defined in the comments.
%C A347683 If u, v are positive integers with gcd(u,v) = 1, the "reduced inverse" red_inv(u,v) of u mod v is u^(-1) mod v if u^(-1) mod v <= v/2, otherwise it is v - u^(-1) mod v.
%C A347683 That is, we map u to whichever of +-u has a representative mod v in the range 0 to v/2. Stated another way, red_inv(u,v) is a number r in the range 0 to v/2 such that r*u == +-1 mod v.
%C A347683 For example, red_inv(3,11) = 4, since 3^(-1) mod 11 = 4. But red_inv(2,11) = 5 = 11-6, since red_inv(2,11) = 6.
%C A347683 Arises in the study of A344005.
%H A347683 N. J. A. Sloane, <a href="/A347683/b347683.txt">Table of n, a(n) for n = 1..5050</a> [The first 100 rows, flattened]
%e A347683 Triangle begins:
%e A347683 0,
%e A347683 1, 0,
%e A347683 1, 5, 0,
%e A347683 1, 0, 7, 0,
%e A347683 1, 9, 11, 9, 0,
%e A347683 1, 0, 0, 0, 11, 0,
%e A347683 1, 13, 13, 15, 29, 13, 0,
%e A347683 1, 0, 17, 0, 31, 0, 15, 0,
%e A347683 1, 17, 0, 17, 19, 0, 55, 17, 0,
%e A347683 1, 0, 19, 0, 0, 0, 41, 0, 19, 0,
%e A347683 ...
%p A347683 myfun1 := proc(A,B) local Ar,Br;
%p A347683 if igcd(A,B) > 1 then return(0); fi;
%p A347683   Ar:=(A)^(-1) mod B;
%p A347683    if 2*Ar > B then Ar:=B-Ar; fi;
%p A347683   Br:=(B)^(-1) mod A;
%p A347683    if 2*Br > A then Br:=A-Br; fi;
%p A347683 A*Ar+B*Br;
%p A347683 end;
%p A347683 for i from 1 to 20 do lprint([seq(myfun1(i,j),j=1..i)]); od:
%Y A347683 Cf. A344005, A347681, A347682, A347684.
%K A347683 nonn,tabl
%O A347683 1,5
%A A347683 _N. J. A. Sloane_, Sep 18 2021