Given an integer N, the task is to find the smallest N-digit number which is a perfect fourth power.
Input: N = 2
Only valid numbers are 24 = 16
and 34 = 81 but 16 is the minimum.
Input: N = 3
44 = 256
Approach: It can be observed that for the values of N = 1, 2, 3, …, the series will go on like 1, 16, 256, 1296, 10000, 104976, 1048576, … whose Nth term will be pow(ceil( (pow(pow(10, (n – 1)), 1 / 4) ) ), 4).
Below is the implementation of the above approach:
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Smallest N digit number whose sum of square of digits is a Perfect Square
- Smallest and Largest N-digit perfect cubes
- Smallest and Largest N-digit perfect squares
- Sum of fourth power of first n even natural numbers
- Find two numbers whose difference of fourth power is equal to N
- Find smallest perfect square number A such that N + A is also a perfect square number
- Largest N digit Octal number which is a Perfect square
- Find the Largest N digit perfect square number in Base B
- Find last five digits of a given five digit number raised to power five
- Smallest number greater than n that can be represented as a sum of distinct power of k
- Smallest N digit number which is a multiple of 5
- Smallest K digit number divisible by X
- Largest and smallest digit of a number
- Smallest n digit number divisible by given three numbers
- C++ Program for Smallest K digit number divisible by X
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.