# Tag Archives: number-theory

## Count ordered pairs with product less than N

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

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 »

## Primality test for the sum of digits at odd places of a number

Given an integer ‘n’, the task is to check whether the sum of digits at the odd positions (from right to left) is prime or… Read More »

## ElGamal Encryption Algorithm

ElGamal encryption is an public-key cryptosystem. It uses asymmetric key encryption for communicating between two parties and encrypting the message. This cryptosystem is based on… Read More »

## Check if a number is an Achilles number or not

Given a positive integer N. The task is to check if N is an Achilles number or not. Print ‘YES’ if N is an Achilles… Read More »

## Program to find count of numbers having odd number of divisors in given range

Given two integers A and B. The task is to count how many numbers in the interval [ A, B ] have an odd number… Read More »

## Check if a number is an Unusual Number or not

Given a positive integer N. The task is to check if N is an unusual number or not. Print ‘YES’ if M is an unusual… Read More »

## Check if difference of areas of two squares is prime

Given two squares with side lengths and (a > b). The task is to check if difference of their areas is prime or not. Here… Read More »

## Program to Convert Hexadecimal Number to Binary

Given a Hexadecimal number as an input, the task is to convert that number to Binary number. Examples: Input: Hexadecimal = 1AC5 Output: Binary =… Read More »

## Gould’s Sequence

Given a positive Integer n, The task is to print Gould’s sequence up to nth term. In Mathematics, Gould’s sequence is an integer sequence whose… Read More »

## Print all Prime Quadruplet of a number less than it

Given a positive integer n, print every Prime Quadruplet below . Prime quadruplet: In mathematics, Prime Quadruplet is a set of four primes of the… Read More »

## Check if a number is Primorial Prime or not

Given a positive number N, the task is to check if N is a primorial prime number or not. Print ‘YES’ if N is a… Read More »

## Check if the given number is Ore number or not

Given a positive integer n, check if it is an Ore number or not. Print ‘YES’ if n is an ore number otherwise print ‘NO’.… Read More »

## Represent a number as a sum of maximum possible number of Prime Numbers

Given a positive integer . The task is to represent it as a sum of the maximum possible number of prime numbers. (N > 1)… Read More »

## Check whether the given numbers are Cousin prime or not

Given two positive integer n1 and n2, the task is to check if both are Cousin primes or not. Print ‘YES’ if the both the… Read More »