Questions tagged [primes]

Primes or prime numbers are numbers which are divisible only by themselves and one, starting with 2, 3, 5, 7, 11.... They are commonly used in encryption and hashing algorithms.

Filter by
Sorted by
Tagged with
-1
votes
2answers
311 views

Prime Number Generator

The purpose of this program is to run an infinite prime generator that won't stop unless I tell the console to stop. This is not a sieve of Eratosthenes; it stores prime numbers in an array and ...
-1
votes
1answer
148 views

Motorola 6809 Prime finder

I'm trying to make a small program which takes a number (form 1 to 1000) and shows the primes between 2 and that number. Right now I have a quite functioning program (except a couple of bugs), but the ...
-2
votes
2answers
81 views

Testing primality

This method accepts an int parameter and verifies if the parameter is a prime number by trial division. It returns a Boolean value of true if it is prime or ...
-3
votes
2answers
178 views
-3
votes
1answer
84 views

Closest Prime Number via Letters [closed]

I'd like this code to be optimized and factorized, along with, perhaps, re-making it so it's more readable via introducing better functions and minimizing the lines needed for it to be human-readable (...
-4
votes
1answer
64 views

Printing a prime normalized sequence

The program below generates a prime normalised sequence. So, what happens is this: It asks you to provide a number within a range. Program then calculates a factor which is inverse of product of all ...
-5
votes
2answers
708 views

Finding the largest prime factor of a 12 digit number [closed]

I created this using C++ and this gives the largest prime factor of a number.But my problem is if I try to find the largest prime factor of a very large number (12 digit number) it gives an error or ...
-5
votes
1answer
78 views

Find pair of adjacent prime numbers in a two-dimensional array

Does anybody know how to find pair of adjacent prime numbers in two-dimensional array, quicker than this? I'm talking especially about this part which looks for adjacent numbers not about function ...

1
10 11 12 13
14