For any integer k, let Nk be the number of ordered 6-tuple (a,b,c,a′,b′,c′) that satisfy
ab+a′b′≡bc+b′c′≡ca+c′a′≡1(modk)
and a,b,c,a′,b′,c′∈{0,1,…,k−1}. By the Chinese Remainder Theorem,
Nmn=Nn×Nm if gcd(n,m)=1.
Therefore, in order to compute N15, we only need to compute N3 and N5. We will compute Np for any p prime. Fix a solution (a,b,a′,b′) of the equation ab+a′b′≡1(modp), we compute the number of solutions of the following system
bc+b′c′≡ca+c′a′≡1(modp)(1)
We consider three cases
* Suppose that (a,a′)=t(b,b′)(modp) for any t∈{0,1,…,p−1}. Then the system (1) has a unique solution
c≡a′b−b′aa′−b′,c′≡ab′−ba′a−b(modp)
* Suppose that (a,a′)≡t(b,b′)(modp) for some t=1. Then the system (1) has no solution.
* Suppose that (a,a′)≡(b,b′)(modp). Then the system (1) becomes a single equation bc+b′c′≡1(modp). Since ba+b′a′≡1(modp), we can assume that b=0. Hence, for any choice of c′, we have only one choice of c≡(1−b′c′)/b(modp). This implies that the system (1) has exactly p solutions.
Let Tp be the number of ordered tuples (a,b,a′,b′) that satisfy ab+a′b′≡1(modp) and a,b,a′,b′∈{0,1,…,p−1}. For any pair (a,a′)=(0,0), there are exactly p pairs (b,b′) satisfy the equation. Hence, Tp=p(p2−1).
Let Cp(t) be the number of ordered pairs (a,b) that satisfy a2+b2≡t(modp) and a,b∈{0,1,…,p−1}. From the above arguments, we have
Np=Tp−t=1∑p−1Cp(t)+pCp(1)=p(p2−1)−p2+Cp(0)+pCp(1).
It is easy to get C3(0)=1,C3(1)=4,C5(0)=9,C5(1)=4, which implies that N3=28,N5=124 and N15=28×124=3472.
Therefore, the number of ordered 6-tuple satisfying the given conditions is 3472. ☐