Tag Archives: Natural Numbers

Given an integer N (N &e; 3), the task is to split all numbers from 1 to N into two subsequences such that the sum… Read More
Given an array arr[] consisting of N positive integers, the task is to minimize the maximum difference between any pair of array elements by multiplying… Read More
Given a positive integer N, the task is to generate two arrays of length N such that the same-indexed elements of both the arrays are… Read More
Given two integers L and R, the task is to count numbers from the range [L, R] having odd digits at odd positions and even… Read More
Given an integer N, the task is to find the sum of first N natural numbers with alternate signs, i.e 1 – 2 + 3… Read More
Given an integer N, the task is to count the numbers in ordered integer partitions of N.Examples:  Input: N = 3 Output: 8 Integer partitions of N(=3)… Read More
Given an integer N, the task is to check if the given number N is even or odd. If it is found to be even,… Read More
Given an integer N, the task is to check if N is the sum of a pair of integers which can be expressed as the… Read More
Given two integers L and R, the task is to find a pair of integers from the range [L, R] having LCM within the range… Read More
Given an array arr[] containing natural numbers from 1 to N, the task is to find the maximum number of elements that can be made… Read More
Given a number N, the task is to find the largest power of 2 that divides LCM of first N Natural numbers. Examples: Input: N… Read More
Given a number N, the task is to check if the number N can be represented as the difference of two consecutive cubes or not.… Read More
Given a number N and a prime number P, the task is to find the sum of the largest divisors of each number in the… Read More