Start with some manipulation
N^4-27N^2+121
= N^4+22N^2+121 - 49N^2
= (N^2+11)^2 - (7N)^2
= (N^2-7N+11) * (N^2+7N+11)
For this expression to evaluate to be noncomposite it is necessary that one of the terms must equal +/-1.
N^2-7N+11=1 has roots 2 and 5
N^2-7N+11=-1 has roots 3 and 4
N^2+7N+11=1 has roots -2 and -5
N^2+7N+11=-1 has roots -3 and -4
All the negative roots are to be discarded, since we are seeking positive values for N. Testing each positive root:
2^4-27*2^2+121 = 29
3^4-27*3^2+121 = -41
4^4-27*4^2+121 = -55
5^4-27*5^2+121 = 71
-41 and -55 are to be discarded, since primes are defined to be positive, leaving 29 and 71 which are both prime. Those two primes occur when N=2 or N=5.