Find the largest positive integer $n < 30$ such that $\frac{1}{2}(n^8 + 3n^4 - 4)$ is not divisible by the square of any prime number.

Let's think step by step and output the final answer within \boxed{}.
user