Let’s note the set of all integers $n>1$ which are not divisible by a square of a prime number. We define the number $f(n)$ as the greatest amount of divisors of $n$ which could be chosen in such way so that for each two chosen $a$ and $b$, not necessarily different, the number $a^2+ab+b^2+n$ is not a square. Find all $m$ for which there exists $n$ so that $f(n)=m$.
Problem
Source: XI International Festival of Young Mathematicians Sozopol 2022, Theme for 11-12 grade
Tags: number theory, Divisors