Definition: a prime power is a natural number that can be expressed in the form pn where p is a prime and n is a natural number.
Task: Given a prime power pn > 1, return the prime p.
Testcases:
input output
9 3
16 2
343 7
2687 2687
59049 3
Scoring: This is code-golf. Shortest answer in bytes wins.
n
be 1? \$\endgroup\$ – user202729 Jun 20 '18 at 10:41n = 1
. \$\endgroup\$ – Emigna Jun 20 '18 at 10:53