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 »
Given a number n, we need to count square numbers smaller than or equal to n. Examples : Input : n = 5 Output :… 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 two fractions a/b and c/d, compare them and print the larger of the two. Examples : Input: 5/6, 11/45 Output: 5/6 Input: 4/5 and… 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:… Read More »
Write a program to find the sum of fourth powers of the first n natural numbers 14 + 24 + 34 + 44 + …….+… Read More »
In number theory, the aliquot sum s(n) of a positive integer n is the sum of all proper divisors of n, that is, all divisors… Read More »
Given a positive integer n such that n > 2. Divide numbers from 1 to n in two groups such that absolute difference of sum… Read More »
Given a number n, the task is to find the even factor sum of a number. Examples: Input : 30 Output : 48 Even dividers… Read More »
Given multiple numbers and a number n, the task is to print the remainder after multiply all the number divide by n. Examples: Input :… Read More »
Given a number n, the task is to find the odd factor sum. Examples : Input : n = 30 Output : 24 Odd dividers… Read More »
Mobius Function is a multiplicative function which is used in combinatorics. It has one of three possible values -1, 0 and 1. Examples: Input :… Read More »