About 1,380,000 results
Open links in new tab
  1. Count number of primes in an array - GeeksforGeeks

    Sep 1, 2022 · Given an array arr[] of N elements. The task is to find the maximum number of the contiguous prime numbers in the given array. Examples: Input: arr[] = {3, 5, 2, 66, 7, 11, 8} …

  2. Check Prime Number in Python - GeeksforGeeks

    Apr 10, 2025 · isprime () function from the SymPy library checks if a number is prime or not. It prints False for 30, True for 13 and True for 2 because 30 is not prime, while 13 and 2 are …

  3. Python Program to Check Prime Number

    In this program, we have checked if num is prime or not. Numbers less than or equal to 1 are not prime numbers. Hence, we only proceed if the num is greater than 1. We check if num is …

  4. Trying to get all prime numbers in an array in Python

    I am trying to print out all prime numbers that are in an array called 'checkMe'. But I just can't get it to work. I've succesfully made a program that checks it for one number but it doesn't work for …

  5. 5 Best Ways to Create a List of Prime Numbers in Python

    Feb 20, 2024 · For this article, we will discuss how to create a list of prime numbers in Python, given a specific range. For example, the input may be 1 through 30, and the desired output …

  6. python - get prime numbers from numpy array - Stack Overflow

    Mar 18, 2016 · nums = np.array([17, 18, 19, 20, 21, 22, 23]) # All prime numbers in the range from 2 to sqrt(max(nums)) divisors = primesfrom2to(int(math.sqrt(np.max(nums)))+1) …

  7. How to Print Prime Numbers from 1 to N in Python? - Python

    Oct 16, 2024 · Here is the complete Python code to print prime numbers from 1 to n in Python. if num <= 1: return False. for i in range(2, int(num**0.5) + 1): if num % i == 0: return False. return …

  8. Python Program to Print Prime Numbers from 1 to 100 - Python

    Oct 20, 2024 · Here is a simple Python program to print prime numbers from 1 to 100 using for loop. if num < 2: return False. for i in range(2, int(num**0.5) + 1): if num % i == 0: return False. …

  9. Check prime numbers in Array against prime index positions

    Aug 22, 2023 · Given an array arr[], the task is to check for each prime number in the array, from its position(indexing from 1) to each non-prime position index, and check if the number present …

  10. Finding Prime Numbers using Python

    Sep 21, 2021 · In this article, we will find out the prime numbers up to 1000 with two examples. First by picking any number and checking if it is prime or not and second, by generating 100 …

  11. Some results have been removed
Refresh