Javascript Program for Prime Numbers
Prime numbers...
read more
Javascript Program for Count Primes in Ranges
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 <= L <= R < 10000. Consider that there are a large number of queries for different ranges.Examples:...
read more
Php Program to Count Primes in Ranges
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 <= L <= R < 10000. Consider that there are a large number of queries for different ranges.Examples:...
read more
Ordered Prime Signature
Given a number n, find the ordered prime signatures and using this find the number of divisor of given n. Any positive integer, ‘n’ can be expressed in the form of its prime factors. If ‘n’ has p1, p2, … etc. as its prime factors, then n can be expressed as : Now, arrange the obtained exponents of the prime factors of ‘n’ in non-decreasing order. The arrangement thus obtained is called the ordered prime signature of the positive integer ‘n’.Example:...
read more
Sum of numbers in a range [L, R] whose count of divisors is prime
Given Q queries where each query consists of an integer range [L, R], the task is to find the sum of the integers from the given range whose count of divisors is prime.Examples:...
read more
Find the sum of prime numbers in the Kth array
Given K arrays where the first array contains the first prime number, the second array contains the next 2 primes and the third array contains the next 3 primes and so on. The task is to find the sum of primes in the Kth array.Examples:...
read more
Minimize swaps required to make all prime-indexed elements as prime
Given an array arr[] of size N. The task is to find the minimum number of swaps required to re-arrange the array such that all prime-indexed elements are prime, If the task can’t be achieved, print “-1“...
read more
Sum of prime numbers without odd prime digits
Given an integer N. The task is to find the sum of the first N prime numbers which don’t contain any odd primes as their digit.Some of such prime numbers are 2, 11, 19, 29, 41 …… Examples:...
read more
Compute power of power k times % m
Given x, k and m. Compute (xxxx…k)%m, x is in power k times. Given x is always prime and m is greater than x....
read more
Count unvisited leaves after Frog Jumps
Given an array arr[] of size N, an integer K representing the number of leaves in the pond, and the arr[i] indicating the strength of the ith frog’s jump, where 0 <= i < N. The frogs are at one end of the pond and are trying to get to the other end by jumping on the leaves, the task is to count the number of unvisited leaves. After each frog has reached the end while ensuring that every frog jumps with its respective strength....
read more
Generate elements of the array following given conditions
Given an integer N, for every integer i in the range 2 to N, assign a positive integer such that the following conditions hold :...
read more
Prime Fibonacci | TCS Mockvita 2020
Given two numbers N1 and N2....
read more