7. (USS 5) For which digits $a$ do there exist integers $n \geq 4$ such that each digit of $\frac{n(n+1)}{2}$ equals $a$?
7. For $a=5$ one can take $n=10$, while for $a=6$ one takes $n=11$. Now assume $a \notin\{5,6\}$. If there exists an integer $n$ such that each digit of $n(n+1) / 2$ is equal to $a$, then there is an integer $k$ such that $n(n+1) / 2=\left(10^{k}-1\right) a / 9$. After multiplying both sides of the equation by 72, one obtains $36 n^{2}+36 n=8 a \cdot 10^{k}-8 a$, which is equivalent to $$ 9(2 n+1)^{2}=8 a \cdot 10^{k}-8 a+9 $$ So $8 a \cdot 10^{k}-8 a+9$ is the square of some odd integer. This means that its last digit is 1, 5, or 9. Therefore $a \in\{1,3,5,6,8\}$. If $a=3$ or $a=8$, the number on the RHS of (1) is divisible by 5, but not by 25 (for $k \geq 2$), and thus cannot be a square. It remains to check the case $a=1$. In that case, (1) becomes $9(2 n+1)^{2}=8 \cdot 10^{k}+1$, or equivalently $[3(2 n+1)-1][3(2 n+1)+1]=8 \cdot 10^{k} \Rightarrow(3 n+1)(3 n+2)=2 \cdot 10^{k}$. Since the factors $3 n+1,3 n+2$ are relatively prime, this implies that one of them is $2^{k+1}$ and the other one is $5^{k}$. It is directly checked that their difference really equals 1 only for $k=1$ and $n=1$, which is excluded. Hence, the desired $n$ exists only for $a \in\{5,6\}$.