## Midy’s theorem

According to Midy’s theorem, if the period of a repeating decimal for , where p is prime and is a reduced fraction, has an even… Read More »

According to Midy’s theorem, if the period of a repeating decimal for , where p is prime and is a reduced fraction, has an even… Read More »

In combinatorics, the Eulerian Number A(n, m), is the number of permutations of the numbers 1 to n in which exactly m elements are greater… Read More »

Given a positive integer N. The task is to find 12 + 22 + 32 + ….. + N2. Examples: Input : N = 4… Read More »

A polite number is a positive integer that can be written as the sum of two or more consecutive positive integers. Given N, find the… Read More »

Given an odd number, we need to express it as the sum of at most three prime numbers. Examples: Input : 27 Output : 27… Read More »

There are several primality test available to check whether the number is prime or not like Fermat’s Theorem, Miller-Rabin Primality test and alot more. But… Read More »

In mathematics, Sexy Primes are prime numbers that differ from each other by six. For example, the numbers 5 and 11 are both sexy primes,… Read More »

The Schröder–Hipparchus numbers form an integer sequence that can be used to count the number of plane trees with a given set of leaves, the… Read More »

Given N, find sum of squares of first N natural number. Examples : Input : n = 2 Output : 5 Explanation: 1^2+2^2 = 5… Read More »

In number theory, a Leyland number is a number of the form xy + yx, where x and y are integers greater than 1 and… Read More »

The positive odd numbers in ascending order as 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, …. and grouped as (1), (3, 5),… Read More »

Given the sequence of odd numbers 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, …. Find the sum of first n… Read More »

Given three integers A, B and K. We need to find no. of K-prime numbers in the range [A, B]. A number is called K-prime… Read More »

Fermat’s little theorem states that if p is a prime number, then for any integer a, the number a p – a is an integer… Read More »

Given a positive integer ‘n’ and query ‘q’. Print all the divisors of number ‘n’. Input: 6 Output: 1 2 3 6 Explanation Divisors of… Read More »