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.

A347682 Array read by antidiagonals: T(n,k) (n>=1, k>=1) = f(prime(n),prime(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 A347682 #19 Dec 10 2023 17:16:15
%S A347682 0,5,5,9,0,9,13,11,11,13,21,13,0,13,21,25,23,29,29,23,25,33,25,21,0,
%T A347682 21,25,33,37,35,51,43,43,51,35,37,45,37,69,27,0,27,69,37,45,57,47,39,
%U A347682 69,131,131,69,39,47,57,61,59,91,113,67,0,67,113,91,59,61,73,61,59,139,153,103,103,153,139,59,61,73
%N A347682 Array read by antidiagonals: T(n,k) (n>=1, k>=1) = f(prime(n),prime(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 A347682 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 A347682 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 A347682 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 A347682 Arises in the study of A344005.
%H A347682 N. J. A. Sloane, <a href="/A347682/b347682.txt">Table of n, a(n) for n = 1..5050</a> [First 100 antidiagonals, flattened]
%e A347682 The array begins:
%e A347682 0, 5, 9, 13, 21, 25, 33, 37, 45, 57, 61, 73,...
%e A347682 5, 0, 11, 13, 23, 25, 35, 37, 47, 59, 61, 73,...
%e A347682 9, 11, 0, 29, 21, 51, 69, 39, 91, 59, 61, 149,...
%e A347682 13, 13, 29, 0, 43, 27, 69, 113, 139, 57, 125, 223,...
%e A347682 21, 23, 21, 43, 0, 131, 67, 153, 45, 175, 309, 221,...
%e A347682 25, 25, 51, 27, 131, 0, 103, 77, 183, 233, 311, 443,...
%e A347682 33, 35, 69, 69, 67, 103, 0, 305, 137, 407, 373, 443,...
%e A347682 37, 37, 39, 113, 153, 77, 305, 0, 229, 115, 495, 75,...
%e A347682 ...
%e A347682 The first few antidiagonals are:
%e A347682 [0]
%e A347682 [5, 5]
%e A347682 [9, 0, 9]
%e A347682 [13, 11, 11, 13]
%e A347682 [21, 13, 0, 13, 21]
%e A347682 [25, 23, 29, 29, 23, 25]
%e A347682 [33, 25, 21, 0, 21, 25, 33]
%e A347682 [37, 35, 51, 43, 43, 51, 35, 37]
%e A347682 ...
%p A347682 myfun1 := proc(A,B) local Ar,Br;
%p A347682 if igcd(A,B) > 1 then return(0); fi;
%p A347682   Ar:=(A)^(-1) mod B;
%p A347682    if 2*Ar > B then Ar:=B-Ar; fi;
%p A347682   Br:=(B)^(-1) mod A;
%p A347682    if 2*Br > A then Br:=A-Br; fi;
%p A347682 A*Ar+B*Br;
%p A347682 end;
%p A347682 myfun2:=(i,j)->myfun1(ithprime(i),ithprime(j));
%p A347682 for i from 1 to 30 do lprint([seq(myfun2(i-j+1,j),j=1..i)]); od:
%Y A347682 Cf. A344005, A347681, A347683, A347684.
%Y A347682 Rows 1 and 2 are (essentially) A076274 and A208296.
%K A347682 nonn,tabl
%O A347682 1,2
%A A347682 _N. J. A. Sloane_, Sep 18 2021