Notice that \(n^5 + n^4 + 1 = (n^2 + n + 1)(n^3 - n + 1)\).
That means, for all \(n^2 + n + 1 \neq 1\) and \(n^3 - n + 1 \neq 1\), \(n^5 + n^4 + 1\) is composite.
This means when \(n^5 + n^4 + 1\) is prime, \(n^2 + n = 0\) or \(n^3 = n\)
Solving, we get n = -1 (rejected) or n = 0 (rejected) or n = 1.
When n = 1, \(n^5 + n^4 + 1 = 3\), which is a prime.
The only possibility is n = 1.