# Tag Archives: number-theory

## Check if all Prime factors of number N are unique or not

Given a number N. The task is to check whether the given number N has unique prime factors or not. If yes then print YES… Read More »

## Dixon’s Factorization Method with implementation

Dixon’s Factorization method is an integer factorization algorithm. In this article, this method is explained to find the factors of a composite number. Dixon Factorization… Read More »

## Find the largest composite number that divides N but is strictly lesser than N

Given a composite number N, the task is to find the largest composite number that divides N and is strictly lesser than N. If there… Read More »

## Find pairs of elements from two different arrays whose product is a perfect square

Prerequisites: Prime Factorization using Sieve Given two arrays arr1[] and arr2[] of size M and N with distinct elements in each of the arrays, the… Read More »

## Check if a number is Prime, Semi-Prime or Composite for very large numbers

Given a very large number N (> 150), the task is to check whether this number is Prime, Semi-Prime or Composite. Example: Input: N =… Read More »

## Sum of all numbers formed having 4 atmost X times, 5 atmost Y times and 6 atmost Z times

Given three integers X, Y and Z, the task is to find the sum of all the numbers formed having 4 atmost X times, 5… Read More »

## Size of the largest divisible subset in an Array

Given an array arr[] of size N. The task is to find the size of the set of numbers from the given array such that… Read More »

## Fermat’s Factorization Method

Fermat’s Factorization method is based on the representation of an odd integer as the difference of two squares. For an integer n, we want a… Read More »

## Goldbach’s Weak Conjecture for Odd numbers

Given an odd number N, the task is to find if the number can be represented as the sum of 3 prime numbers. Examples: Input:… Read More »

## Find the player who will win the Coin game

Given N coins, the task is to find who win the coin game. Coin game is a game in which each player picks coins from… Read More »

## Find the count of natural Hexadecimal numbers of size N

Given an integer N, the task is to find the count of natural Hexadecimal numbers with N digits. Examples: Input: N = 1 Output: 15… Read More »

## Largest Even and Odd N-digit numbers in Octal Number System

Given an integer N, the task is to find the largest even and odd N-digit numbers in Octal Number System. Examples: Input: N = 4… Read More »

## Find the number of pairs such that their gcd is equals to 1

Given an array a of size N. The task is to find the number of pairs such that gcd(a[i], a[j]) where 1 ≤ i <… Read More »

## Program for Mobius Function | Set 2

Given an integer N. The task is to find Mobius function of all numbers from 1 to N. Examples: Input: N = 5 Output: 1… Read More »

## Count of all possible pairs of disjoint subsets of integers from 1 to N

Given an integer N. Consider the set of first N natural numbers A = {1, 2, 3, …, N}. Let M and P be two… Read More »