5. A number is called triangular if it equals the sum of several consecutive natural numbers, starting from 1. Can the number 2015 be represented as the difference of two four-digit triangular numbers?
5. Answer: Yes, it can be. Let \( A=1+2+\ldots+n, B=1+2+\ldots+k \) be two triangular numbers, then \( A=\frac{n(n+1)}{2}, B=\frac{k(k+1)}{2} \). Let \( 2015=A-B \Rightarrow n(n+1)-k(k+1)=4030 \). Factorize both sides of this equation, we get \( (n-k)(n+k+1)=2 \cdot 5 \cdot 13 \cdot 31 \). Note that \( n-k < n+k+1 \) and they are of different parity. Suppose, for example, \( n-k=2 \cdot 13=26 \), and \( n+k+1=5 \cdot 31=155 \). Solve the resulting system of equations, then \( n=90, k=64 \). Find \( A=\frac{90 \cdot 91}{2}=4095, B=\frac{64 \cdot 65}{2}=2080 \).

Criteria: A fully justified solution - 7 points. The correct formula for triangular numbers is obtained, a correct factorization of the number 2015 or 4030 is presented, but when working with the system of equations, non-four-digit triangular numbers are obtained - 3 points. In all other cases - 0 points.