Problem

Source: Kyiv mathematical festival 2018

Tags: Kyiv mathematical festival, number theory



Find all positive integers $n$ for which the largest prime divisor of $n^2+3$ is equal to the least prime divisor of $n^4+6.$