The prime-numbers tag has no wiki summary.
7
votes
1answer
148 views
Testing for primality in quadratic rings?
Testing for primality in $\mathbb{Z}[\sqrt{-1}]$ in Mathematica is easy:
PrimeQ[n, GaussianIntegers -> True]
But how can I test for primality in, say, ...
13
votes
2answers
288 views
Why does iterating Prime in reverse order require much more time?
Say I would like to display the $10$ greatest primes that are less than $10^5$. I could do the following:
...
5
votes
3answers
375 views
Fast Sieve Implementation
I'm going to write a code to compete in performance with NewPGen. The goal is to sieve numbers that have small factors. Mine is very slow in compare with NewPGen.
Here's my code:
...
30
votes
9answers
1k views
Happy 2K prime question
This being the Q number 2K in the site, and this being the day we got the confirmation of mathematica.se graduating soon, I think a celebration question is in order.
So...
What is the fastest way to ...
8
votes
2answers
227 views
Is there a way to use functions like Prime[n] within Solve[]?
I'm trying to see if a number can be written as the sum of two prime numbers. Ideally, I would like to use
Solve[Prime[n] + Prime[m] == 100, {n, m}]
But that ...
4
votes
1answer
231 views
Time approximation of decrypting RSA algorithm
I've written a function that encrypts a text using the RSA algorithm. It then decrypts it using prime factorization, and takes the time it took to decrypt it and puts it in a vector together with the ...
1
vote
1answer
279 views
Equivalent of Python's “all” function in Mathematica
The Python function
def isPrime(n):
return all(n % i for i in xrange(2, n))
checks if a number is a prime number by using ...
