Given an integer N, the task is to check whether N the given number can be made a perfect square after adding 1 to it.
3 + 1 = 4 which is a perfect square i.e. 22
5 + 1 = 6 which is not a perfect square.
Approach: Check whether n + 1 is a perfect square or not by taking the square root of n + 1 and checking whether it is an integer. If it is then n + 1 is a perfect square and n is a sunny number.
Below is the implementation of the above approach:
- Check if a number is perfect square without finding square root
- Check if given number is perfect square
- Check perfect square using addition/subtraction
- Largest number that is not a perfect square
- Find minimum number to be divided to make a number a perfect square
- Largest factor of a given number which is a perfect square
- Find the Next perfect square greater than a given number
- Count numbers upto N which are both perfect square and perfect cube
- Largest Divisor of a Number not divisible by a perfect square
- Minimum digits to remove to make a number Perfect Square
- Program to check Plus Perfect Number
- PHP | Check if a number is Perfect number
- Perfect Square String
- Closest perfect square and its distance
- Count of pairs in an array whose sum is a perfect square