## Sum of first N natural numbers which are divisible by X or Y

Given a number N. Given two numbers X and Y, the task is to find the sum of all those numbers from 1 to N… Read More »

- Top 10 Algorithms and Data Structures for Competitive Programming
- Sieve of Eratosthenes
- How to prepare for ACM - ICPC?
- Factorial of a large number
- Lexicographic rank of a string
- Check whether a number is semiprime or not
- Modulo 10^9+7 (1000000007)
- Primality Test | Set 1 (Introduction and School Method)
- Modular multiplicative inverse
- Number Theory (Interesting Facts and Algorithms)
- Find Excel column name from a given column number
- Euler's Totient Function
- RSA Algorithm in Cryptography
- Primality Test | Set 2 (Fermat Method)
- Primality Test | Set 3 (Miller–Rabin)
- Finding sum of digits of a number until sum becomes single digit
- Compute nCr % p | Set 3 (Using Fermat Little Theorem)
- Find largest prime factor of a number
- Check if a number can be expressed as x^y (x raised to power y)
- k-Rough Number or k-Jagged Number
- Lemoine's Conjecture
- Common Divisors of Two Numbers
- Fermat's little theorem
- Check if a number can be written as a sum of 'k' prime numbers
- Compute n! under modulo p
- Efficient program to print the number of factors of n numbers
- Sum of all the factors of a number
- Primality Test | Set 4 (Solovay-Strassen)
- Stormer Numbers
- Number of occurrences of 2 as a digit in numbers from 0 to n

Given a number N. Given two numbers X and Y, the task is to find the sum of all those numbers from 1 to N… Read More »

Given a number N. The task is to find first N Iccanobif Numbers. Iccanobif Numbers are similar to Fibonacci Numbers. The K-th Iccanobif number can… Read More »

Given a number N. The task is to find the count of numbers which have N digits and even number of zeroes. Note: The number… Read More »

Given two integers L and R, the task is to find the sum of all even numbers in range L and R. Examples: Input: L… Read More »

Given an even number N. The task is to consider numbers from 1 to N2, split them into N groups of the equal sum. Examples:… Read More »

Given two number A and B, the task is to find the sum of common factors of two numbers A and B. The numbers A… Read More »

Given a prime . The task is to count all the primitive roots of . A primitive root is an integer x (1 <= x… Read More »

Given an array of size and an integer . Perform the following operations on the given array: If a[i] > M then push a[i] –… Read More »

Given sum and gcd of two numbers and . The task is to find both the numbers a and b. If the numbers do not… Read More »

Given a number . Reduce this number to zero by subtracting the number by it’s most significant digit(Left most digit) at every step. The task… Read More »

Given a number N and a number K, the task is to find the smallest number greater than or equal to N which is divisible… Read More »

Given an integer N, below operations can be performed any number of times on N: Multiply N by any positive integer X i.e. N =… Read More »

Given an Integer N. The task is count numbers P less than N such that P is a product of two distinct perfect squares. Examples:… Read More »

Given an integer N. The task is to count the number of ordered pairs (a, b) such that . Examples: Input: N = 5 Output:… Read More »

Greatest Integer Function [X] indicates an integral part of the real number which is nearest and smaller integer to . It is also known as… Read More »