Problem 51221. Determine if a number (x) is a power of another (n)
If the number x is indeed a power of n, then return true. Otherwise, return false.
For example, if x = 9 and n =3, then pow = true.
If x = 6 and n = 2, then pow = false.
You can assume x and n are both positive integers.
Solution Stats
Problem Comments
-
1 Comment
Rafael S.T. Vieira
on 8 Nov 2022
The problem needs more tests.
Solution Comments
Show commentsProblem Recent Solvers26
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15765 Solvers
-
Return a list sorted by number of occurrences
2888 Solvers
-
Find the peak 3n+1 sequence value
2564 Solvers
-
Calculate the area of a triangle between three points
3400 Solvers
-
438 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!