Find the sum of numbers from 1 to n excluding those which are powers of K
Given two integer N and K, the task is to find the sum of all the numbers from the range [1, N] excluding those which are powers of K. Examples: Input: N = 10, K = 3 Output: 42 2 + 4 + 5 + 6 + 7 + 8 + 10 = 42 1, 3 and 9 are excluded as they are powers of 3.Input: N = 200, K = 30 Output: 20069 Recomm