Note that the puzzle can be solved by performing t successive squarings modulo n, beginning with the value 2. That is, set
W(0) = 2
W(i+1) = (W(i) ^ 2) (mod n) for i=1, 2, ...
and compute W(t).
There is no known way to perform this computation more quickly than to perform the t squarings sequentially, unless the factorization of n is known.