## Primality Test | Set 5(Using Lucas-Lehmer Series)

In this article we will discuss about Lucas-Lehmer series which is used to check primality of prime numbers of the form 2p – 1 where… Read More »

In this article we will discuss about Lucas-Lehmer series which is used to check primality of prime numbers of the form 2p – 1 where… Read More »

Given N, check if the number is Fibbinary Number or not. Fibbinary numbers are integers whose binary representation contains no consecutive ones. Examples: Input :… Read More »

A P-smooth number or P-friable number is an integer whose largest prime factor is less than or equal to P. Given N and P, we… Read More »

Given a range [L, R], and a prime number P. We are required to find the sum of the highest power of P in all… Read More »

Give a positive integer n, find modular multiplicative inverse of all integer from 1 to n with respect to a big prime number, say, ‘prime’.… Read More »

Given two integers N and D, Find a set of N integers such that difference between their product and sum is equal to D. Examples… Read More »

Given two numbers, fact and n, find the largest power of n that divides fact! (Factorial of fact). Examples: Input : fact = 5, n… Read More »

Write a program to print first n non-square number (non perfect square) . Examples: Input : 5 Output : 2 3 5 6 7 Input… Read More »

Given a number n, we need to count square numbers smaller than or equal to n. Examples: Input : n = 5 Output : Square… Read More »

Given two integer N or M find the number of zero’s trailing in product of factorials (N!*M!)? Examples: Input : N = 4, M =… Read More »

Given an odd number n, find the average of odd numbers from 1 to n. Examples: Input : n = 9 Output : 5 Explanation… Read More »

Write a program to find the sum of Fifth powers of the first n natural numbers 15 + 25+ 35 + 45+ …….+ n5 till… Read More »

Given a number n, find sum of square of first n odd natural numbers. Examples: Input : 3 Output : 35 12 + 32 +… Read More »

Given a number n, find sum of square of first n even natural numbers. Examples: Input : 3 Output : 56 22 + 42 +… Read More »

Given a number (N), check if it is pentagonal or not. Examples: Input: 12 Output: Yes Explanation: 12 is the third pentagonal number Input: 19… Read More »