Sudhir sharma has Published 1206 Articles

Prime factors of a big number in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 11:04:19

863 Views

In this problem, we are given an integer N

Prime factors of LCM of array elements in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 11:01:51

116 Views

In this problem, we are given an array within the range 1

Prime Number of Set Bits in Binary Representation in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:57:50

164 Views

In this problem, we are given two integers L and R. Our task to print the total numbers that have set bits counting to a prime number that is in between L to R.Let’s take an example to understand the problemInput: L = 7, R = 12 Output: 6 Explanation: ... Read More

Prime numbers after prime P with sum S in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:53:23

246 Views

In this problem, we are given three numbers, sum S, prime P, and N. Our task is to find all N prime numbers greater than P whose sum is equal to S.Let’s take an example to understand our problemInput: N = 2, P = 5, S = 18 Output: 7 ... Read More

Prime numbers and Fibonacci in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:49:44

635 Views

In this problem, we are given a number n. Our task is to print all prime and Fibonacci numbers less than or equal to n.Let’s take an example to understand the problemInput: n = 30 Output: 2 3 5 13ExplanationFibonacci numbers less than 30 are : 1 1 2 3 ... Read More

Prime points (Points that split a number into two primes) in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:39:59

111 Views

In this problem, we are given a number N. Our task is to print all prime points of the number otherwise print -1, if there is no prime point.Prime points are those index values which split the number into two prime numbers, one on the left and other on the ... Read More

Prime String in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:35:33

321 Views

In this problem, we are given a string. Our task is to print YES / NO based on is the sum of ASCII values of the characters of the string is prime or not.ASCII values are character encodingsPrime number is a number that is divisible only by the number itself ... Read More

Prime Triplet in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:33:02

267 Views

In this problem, we are given a number N. Our task is to print all prime triplets less than N.Prime triplet is a set of three prime numbers. That are of the form (p, p+2, p+6) or (p, p+4, p+6). All prime numbers are grouped according to the above triplets ... Read More

Primitive root of a prime number n modulo n in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:29:48

990 Views

In this problem, we are given a prime number N. our task is to print the primitive root of prime number N modulo N.Primitive root of prime number N is an integer x lying between [1, n-1] such that all values of xk (mod n) where k lies in [0, ... Read More

Primorial of a number in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 10:24:24

370 Views

In this problem, we are given a number n. Our task is to print its primorial number.Primorial number (Pn#) is a number that is the product of first n prime numbers.Primorial number is similar to factorial of a number n. The difference is that factorial can be any number but ... Read More

Advertisements