Interview Question

Software Engineer, New College Graduate Interview

-

WePay

Write a function that returns the nth power number, where a power number is a number that can be expressed as x^y. Note that the power number sequence is in ascending order (4, 8, 9, 16, 27, 32, ...).

AnswerAdd Tags

Interview Answers

3 Answers

0

Would 25 also be a power number? 5^2

Anonymous on

0

Can y=1?

Anonymous on

0

This is the actual series 4, 8, 9, 25, 27, 32, 36. Here x, y > 1, so the smallest power number will be 2^2 i.e. 4

Prashant on

Add Answers or Comments

To comment on this, Sign In or Sign Up.