We have an array of $n$ positive integers, and for each we need to know if it is T-prime or not.
T-prime condition: A number $x$ is T-prime if and only if $x$ has exactly three positive divisors. That is, $\abs{A} = 3$ where $ A = \set{y : y \mod x \equiv 0, x \gt 0}$
To solve this problem, we'll use the sieve to determine all the primes up to our bound, then check divisors. We want to know if $x$ has exactly three positive divisors. $1$ is the first positive divisor, and $x$ is the second. The only way there is exactly one more, is if $x$ is a perfect square, whose root is prime.