Given a positive number N, the task is to check whether the given number N can be expressed in the form of ax + by where x and y > 1 and a and b > 0. If N can be expressed in the given form then print true otherwise print false.
Examples:
Input:_ N = 5_
Output:_ true_
Explanation:
_5 can be expressed as 22+12 _
Input:_ N = 15_
Output:_ false_
Approach: The idea is to use the concept of perfect powers to determine whether the sum exists or not. Below are the steps:
#greedy #mathematical #maths #maths-power #numbers