How to find the nth Magic Number?
Wed Dec 25 2019 13:48:42 GMT+0000 (Coordinated Universal Time)
Saved by @marshmellow #php #interviewquestions #makethisbetter
A magic number is defined as a number which can be expressed as a power of 5 or sum of unique powers of 5. First few magic numbers are 5, 25, 30(5 + 25), 125, 130(125 + 5), …. This is how to write a function that finds the nth Magic number.
https://www.geeksforgeeks.org/find-nth-magic-number/
Comments
@logicloss01 - Thu Dec 26 2019 19:04:38 GMT+0000 (Coordinated Universal Time)Thanks.. needed this for a paper!