Problem 711. What digit is it?
The function you are being asked to write will take three numbers (n,x,q) as input. The object of the function is to determine what the qth digit (counting from the front) is of n^x.
For example, if the input is whatdigit(3,7,2), your function will need to determine the 2nd digit of 3^7. 3^7=2187, and the 2nd digit is 1. Therefore, the correct output will be y=1.
All digits will be positive integers, and there will always be at least q digits in n^x.
Solution Stats
Problem Comments
-
2 Comments
Sorry but I don't know how to deal big number.
1.963880521767866e+283 ?
Here's another CODY problem that deals with something similar:
http://www.mathworks.com/matlabcentral/cody/problems/553-how-to-multiply
Solution Comments
Show commentsProblem Recent Solvers40
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6532 Solvers
-
Count from 0 to N^M in base N.
237 Solvers
-
160 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
239 Solvers
-
Is the paranthesis sequence balanced ?
188 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!