# Tag Archives: number-theory

## Thabit number

Given a positive integer n, the task is to check if it is a Thabit number. If the given number is a Thabit number then… Read More »

## Value of the series (1^3 + 2^3 + 3^3 + … + n^3) mod 4 for a given n

Given a function f(n) = (13 + 23 + 33 + … + n3), the task is to find the value of f(n) mod 4… Read More »

## Count all the numbers in a range with smallest factor as K

Given a range of integer from ‘a’ to ‘b’ . Our task is to calculate the amount of numbers from the interval [ a, b… Read More »

## Find the k-th smallest divisor of a natural number N

You’re given a number N and a number K. Our task is to find the kth smallest divisor of N.Examples:  Input : N = 12,… Read More »

## Find N digits number which is divisible by D

Given and . The task is to find a N digits number which is divisible by D ( 2 <= D <= 10). If it… Read More »

## Program to solve the Alligation Problem

Write a program to find the ratio in which a shopkeeper will mix two types of rice worth Rs. kg and Rs. kg, so that… Read More »

## Check if a number is Quartan Prime or not

Given a positive integer N, check if it is Quartan prime or not. Print ‘Yes’ if it is a Quartan prime otherwise Print ‘No’. Quartan… Read More »

## Check if a number has digits in the given Order

Given a number N. The task is to check if the digits of the number follow any of the below order: The digits are in… Read More »

## Check if a number is a Pythagorean Prime or not

Given a positive integer N, check if it is Pythagorean prime or not. If it is a Pythagorean prime, print ‘Yes’ otherwise print ‘No’. Pythagorean… Read More »

## Find minimum possible digit sum after adding a number d

Given a number n and a number d, we can add d to n as many times ( even 0 is possible ). The task… Read More »

## Ways to write N as sum of two or more positive integers | Set-2

Given a number N, the task is to find the number of ways N can be partitioned, i.e. the number of ways that N can… Read More »

## Check whether a given Number is Power-Isolated or not

Given a integer N, with prime factorisation n1p1 * n2p2 …… The task is to check if the integer N is power-isolated or not. An… Read More »

## Program to Add Two Complex Numbers

Given two complex numbers of the form and , the task is to add these two Complex Numbers. Here the values of real and imaginary… Read More »

## Divide a number into two parts such that sum of digits is maximum

Given a number N. The task is to find the maximum possible value of SumOfDigits(A) + SumOfDigits(B) such that A + B = n (0<=A,… Read More »

## Sum of Digits in a^n till a single digit

Given two numbers a and n, the task is to find the single sum of digits of a^n (pow(a, n)). In single digit sum, we… Read More »