isIntpower(1) # 1 1
isIntpower(15) # 15 1
isIntpower(17) # 17 1
isIntpower(64) # 8 2
isIntpower(36) # 6 2
isIntpower(100) # 10 2
if (FALSE) {
for (p in 5^7:7^5) {
pp <- isIntpower(p)
if (pp[2] != 1) cat(p, ":\t", pp, "\n")
}}
Run the code above in your browser using DataLab