Problem

Source: Bulgarian Autumn Math tournament, 2024, p11.4

Tags: algebra, number theory



Find the smallest number $n\in\mathbb{N}$, for which there exist distinct positive integers $a_i$, $i=1,2,\dots, n$ such that the expression $$\frac{(a_1+a_2+\dots+a_n)^2-2025}{a_1^2+a_2^2+\dots +a_n^2 } $$is a positive integer. (proposed by Marin Hristov)