Find all integers $n \ge 2$ for which there exists $n$ integers $a_1,a_2,\dots,a_n \ge 2$ such that for all indices $i \ne j$, we have $a_i \mid a_j^2+1$.
Problem
Source: Francophone 2024, Junior P4
Tags: number theory, number theory proposed, Divisibility, Sequence