# [Jelly], 11 [bytes] µÆE;¬g/’µ#Ṫ [Try it online!]. ### Background Every positive integer **k** can be factorized uniquely as the product of powers of the first **m** primes, i.e., **k = p<sub>1</sub><sup>α<sub>1</sub></sup>⋯p<sub>m</sub><sup>α<sub>m</sub></sup>**, where **α<sub>m</sub> > 0**. We have that **a<sup>b</sup>** (**b>1**) for some positive integer **a** if and only if **b** is a divisor of all exponents **α<sub>j</sub>**. Thus, an integer **k > 1** is a perfect power if and only if **gcd(α<sub>1</sub>, ⋯, α<sub>m</sub>) ≠ 1**. ### How it works µÆE;¬g/’µ#Ṫ Main link. No arguments. µ Make the chain monadic, setting the left argument to 0. µ# Find the first n integers k, greater or equal to 0, for which the preceding chain returns a truthy value. In the absence of CLAs, n is read implicitly from STDIN. ÆE Compute the exponents of the prime factorization of k. ;¬ Append the logical NOT of k, i.e., 0 if k > 0 and 1 otherwise. This maps 1 -> [0] and [0] -> [1]. g/ Reduce the list of exponents by GCD. In particular, we achieved that 1 -> 0 and 0 -> 1. ’ Decrement; subtract 1 from the GCD. This maps 1 to 0 (falsy) and all other integers to a truthy value. Ṫ Tail; extract the last k. [bytes]: https://github.com/DennisMitchell/jelly/wiki/Code-page [Jelly]: http://github.com/DennisMitchell/jelly [Try it online!]: http://jelly.tryitonline.net/#code=wrXDhkU7wqxnL-KAmcK1I-G5qg&input=MTA