Skip to content

Tag Archives: number-theory

Given an integer N, the task is to print first N Mosaic numbers. A Mosaic number can be expressed as follows: If N = p1a1p2a2…pkak… Read More
Given a number N, the task is to find the number of ways of writing N as a sum of 4 squares. Two representations are… Read More
Given an integer N, the task is to find the Nth Mosaic number. A Mosaic number can be expressed as follows: If N = Aa *… Read More
Given a N x N Chessboard. The task is to count distinct rectangles from the chessboard. For example, if the input is 8 then the… Read More
Given an array arr[] containing N positive integer. The task is to find the sum of all the perfect numbers from the array. A number is… Read More
Given an array of numbers and the value of , check if each number can be expressed as the product of exactly prime numbers. For every element of the… Read More
Apart from Sieve of Eratosthenes method to generate Prime numbers, we can implement a new Algorithm for generating prime numbers from 1 to N. It… Read More
There are two players P1 and P2 and two piles of coins consisting of M and N coins respectively. At each turn, a player can… Read More
Given a number X and an array of N numbers. The task is to print all the numbers in the array whose set of prime… Read More
Given a 3-digit number N, the task is to find if N is an Osiris number or not. Osiris numbers are the numbers that are… Read More
Given an integer n, the task is to check if n is a Dudeney number or not. A Dudeney number is a positive integer that… Read More
Given an integer N, the task is to check if N is a Dihedral prime number or not. A Dihedral prime is a prime number… Read More
Given three integer n, m and k. Find the element at kth position after repeating the given operation n number of times. In a single… Read More
Given an array arr[] of size N. The task is to find the length of the longest subsequence from the given array such that the… Read More

Start Your Coding Journey Now!