Given j (1<j<n), the number of ternary groups (i,j,k) satisfying 1≤i<j<k≤n and
ak−ajaj−ai=r1◯
is denoted as gj(r). For fixed i,j with i<j, there is at most one k satisfying ①; so there are j−1 ways to choose i, which means gj(r)≤j−1. In a similar way, for fixed j,k with k>j, there is at most one i satisfying ①; so there are n−j ways to choose k, which means gj(r)≤n−j. Therefore,
gj(r)≤min{j−1,n−j}.
Then, when n is even (i.e., n=2m), we have
fn(r)=j=2∑n−1gj(r)=j=2∑m−1gj(r)+j=m∑2m−1gj(r)≤j=2∑m(j−1)+j=m+1∑2m−1(2m−j)=2m(m−1)+2m(m−1)=m2−m<m2=4n2.
When n is odd (i.e. n=2m+1), we have
fn(r)=j=2∑n−1gj(r)=j=2∑mgj(r)+j=m+1∑2mgj(r)≤j=2∑m(j−1)+j=m+1∑2m(2m+1−j)=m2<4n2.
The proof is completed. □