Let ℤ and ℕ be the set of integers and the set of positive integers, respectively. For a,b,c,d,n∈ℕ let N(a,b,c,d;n) be the number of representations of n by ax2+by2+cz2+dw2, and let t(a,b,c,d;n) be the number of representations of n by ax(x−1)/2+by(y−1)/2+cz(z−1)/2+dw(w−1)/2(x,y,z,w∈ℤ). In this paper, we reveal the connections between t(a,b,c,d;n) and N(a,b,c,d;n). Suppose a,n∈ℕ and 2∤a. We show that
t(a,b,c,d;n)=23N(a,b,c,d;8n+a+b+c+d)−2N(a,b,c,d;2n+a+b+c+d4)
for (a,b,c,d)=(a,a,2a,8m), (a,3a,8k+2,8m+6), (a,3a,8m+4,8m+4) (n≡m+a−12(mod2)) and (a,3a,16k+4,16m+4) (n≡a−12(mod2)). We also obtain explicit formulas for t(a,b,c,d;n) in the cases (a,b,c,d)=(1,1,2,8), (1,1,2,16), (1,2,3,6),(1,3,4,12), (1,1,3,4), (1,1,5,5), (1,5,5,5), (1,3,3,12), (1,1,1,12), (1,1,3,12) and (1,3,3,4).