Given two integers N & K. The task is to find the nearest power of K for the integer N. If there are two nearest… Read More

# Tag Archives: maths-power

Given two integers L and R. The task is to find the sum of all the odd numbers which are perfect square in the range… Read More

Given a non-negative integer N, the task is to check if that integer can be represented as a summation of multiples of 3, 5, and… Read More

Given string str of size N, the task is to print the characters of string whose frequency is a power of K in a lexicographically… Read More

Given an array arr[] with N non-negative integers, find the maximum number of elements that are the same non-negative powers of their indices. arr[i] =… Read More

Given an array arr[] with N non-negative integers, the task is to find the number of elements that are Kth powers of their indices, where… Read More

Given a positive integer N, the task is to express 2^N in the sum of powers of 2 and in exactly N+1 terms. Print those… Read More

Given two positive integers N and K. The task is to find the Kth number that can be written as the sum of different non-negative… Read More

Given a range [L, R], the task is to find the count of numbers in the range [L, R] that can be expressed as a… Read More

Given an integer N, the task is to find the minimum number of steps required to change the number N to a perfect power of… Read More

Given three integers A, N and P, the task is to find (A^(N!)) % P. Examples:Attention reader! Don’t stop learning now. Get hold of all… Read More

Given a string S consisting of N digits, the task is to print all possible combinations of the digits of the S that is a… Read More

Given a sorted array arr[] of the first N Natural Numbers and an integer X, the task is to print the last remaining element after… Read More

Given a string S of size N and containing digits in the range [0-9], the task is to print the count of all the unique… Read More

Given an array arr[] consisting of N integers, the task is to find the minimum number of operations required to make the array non-decreasing by… Read More