# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a094595 Showing 1-1 of 1 %I A094595 #15 Dec 21 2023 11:00:59 %S A094595 1,2,6,5,17,3,31,7,23,5,47,5,60,15,20,12,78,12,78,10,35,18,91,9,74,19, %T A094595 50,9,120,7,110,38,56,30,65,9,171,41,67,12,169,16,143,36,55,17,162,12, %U A094595 143,19,55,28,171,13,113,23,71,33,201,6,265,50,59,45 %N A094595 Number of solutions to 1 == nxy (mod z) == nyz (mod x) == nzx (mod y) with 0 < x < y < z. %C A094595 Prime values of n yield many more solutions than composite values. If (x,y,z) is a solution, then (nx,ny,nz) is a solution of the equations in A094185. All solutions appear to be in the polytope n < x <= 2n+1, x < y <= 2n^2+2n-1, y < z <= n^4+2n^3+2n^2+n-1. %C A094595 There are at least two solutions for all n > 1, given by (x,y,z) = (n+1, n^2+n+1, n^4+2n^3+2n^2+n-1) and (x,y,z) = (n+1, 2n^2+2n-1, 2n^2+2n+1). Following the linked solution by Silvia Fernández, it can be shown that all solutions satisfy 1 < x <= 3n - 1, x < y <= 2nx - 1, and y < z <= nxy - 1. Contrary to the above comment, there are solutions satisfying x > 2n+1. The first such example is given by (x,y,z) = (31,45,59) when n = 14. - _Robin Visser_, Dec 18 2023 %H A094595 Robin Visser, Table of n, a(n) for n = 1..300 %H A094595 Donald Knuth, Silvia Fernández and Gerry Myerson, A Modular Triple: 11021, Amer. Math. Monthly, 112 (2005), p. 279. %e A094595 a(2) = 2 because there are 2 solutions: (x,y,z) = (3, 7, 41) and (3, 11, 13). %t A094595 Table[cnt=0; Do[d=Divisors[n*x*y-1]; Do[z=d[[i]]; If[z>y && Mod[n*x*z, y]==1 && Mod[n*y*z, x]==1, cnt++ ], {i, Length[d]}], {x, 3n-1}, {y, x+1, 2n*x-1}]; cnt, {n, 64}] %o A094595 (Sage) %o A094595 def a(n): %o A094595 ans = 0 %o A094595 for x in range(2, 3*n): %o A094595 for y in range(x+1, 2*n*x): %o A094595 for z in Integer(n*x*y-1).divisors(): %o A094595 if (z > y) and ((n*y*z)%x)==1 and ((n*z*x)%y)==1: %o A094595 ans += 1 %o A094595 return ans # _Robin Visser_, Dec 18 2023 %Y A094595 Cf. A094185 (number of solutions to n = xy (mod z) = yz (mod x) = zx (mod y) with 0