## Sum of the series 1.2.3 + 2.3.4 + … + n(n+1)(n+2)

Find the sum up to n terms of the series: 1.2.3 + 2.3.4 + … + n(n+1)(n+2). In this 1.2.3 represent the first term and… Read More »

## Permutation of numbers such that sum of two consecutive numbers is a perfect square

Prerequisite: Hamiltonian Cycle Given an integer n(>=2), find a permutation of numbers from 1 to n such that the sum of two consecutive numbers of… Read More »

## 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 »

## Fibbinary Numbers (No consecutive 1s in binary)

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 »

## P-Smooth Numbers or P-friable Number

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 »

## Sum of largest divisible powers of p (a prime number) in a range

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 »

## Modular multiplicative inverse from 1 to n

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 »

## Find N integers with given difference between product and sum

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 »

## Print numbers having first and last bits as the only set bits

Given a positive integer n. The problem is to print numbers in the range 1 to n having first and last bits as the only… Read More »

## Find maximum power of a number that divides a factorial

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 »

## Program to print non square numbers

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

## Count square and non-square numbers before n

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

## Trailing number of 0s in product of two factorials

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 »

## Average of odd numbers till a given odd number

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

## Sum of fifth powers of the first n natural numbers

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