The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
24 views

Find a positive integer x - primite root with mod p [migrated]

So I am studying for finals and I am not able to solve the problem: Let $p=3∗2^{11484018}−1$ be a prime with 3457035 digits. Find a positive integer $x$ so that $2^x \equiv 3 \mod p$ Any guidance ...
1
vote
2answers
65 views

Infinite sums with Boole and EvenQ

Suppose I am interested in a sum across a set of even numbers, such as: Sum[x, {x, 2, 20, 2}] 110 or ...
3
votes
2answers
88 views

Prime power list

Update Is there any better way of generating the nth prime power? Chip Hurst gave a great solution for a list below, so ...
0
votes
0answers
16 views

prime number greater than 100 [migrated]

I 'm confused about prime number. It is possible that we can find a not prime number that is greater than 100 and not divided by {2,3,5,7,9}. because someone said to me that we can check if a ...
0
votes
1answer
52 views

Consecutive integers that can be written as the product of three distinct primes

Mathematica novice here. I want to start with a list of integers that are the product of three distinct primes m,n, and o, where 2 <= m|n|o < 2000. ...
2
votes
1answer
79 views

One of the factors greater than $x$ [closed]

Is there an easy way to tell Mathematica to find one of the prime factors of $n$ greater than $x$. For example, if $n=1299709\cdot 7919 \cdot 17$, is there a way to request a factor greater than ...
-2
votes
1answer
84 views

Missing Primes in List [closed]

In the following code why do I get even numbers instead of primes only: ...
5
votes
2answers
185 views

Approximation to the prime counting function

Is there a function similar to PrimePi that gives approximate value for large numbers? In particular, I need a reasonably good approximation for $\pi(x)$, where ...
10
votes
4answers
494 views

Set of integers not divisible by smaller set of primes

Let $p_n$ be the sequence of prime numbers, and $s(x,n)=$ the set of integers less or equal than $x$ that are not divisible by $p_1,\dots,p_n.$ I can define it as follows: ...
0
votes
2answers
93 views

prime-palindromic number selected from a list

I want to find all prime-palindromic numbers up to 5000. Prime-palindromic numbers are numbers that themselves and their reverse digits are both primes. For example, 31 is a prime-palindromic number ...
7
votes
4answers
518 views

Generating an Ulam spiral

An Ulam Spiral is quite an interesting construction, revealing unexpected features in the distribution of primes. Here is a related topic with one answer by Pinguin Dirk, who has provided one ...
2
votes
1answer
97 views

Symbolic multiplicative partitions

Let $p_n\#\equiv\prod_{k=1}^{n}p_k$ (primorial): p[n_] := Times @@ Prime[Range[n]] then the multiplicative partitions of $p_{1,2,3,4}\#$ are $$ \{\{2\}\},$$$$ ...
5
votes
0answers
104 views

Is there a PrimeQ whose accuracy guarantee you can adjust?

Say I have a list of a million integers each with a million digits, and I want a crude sieve to see which have a chance at being prime. Mathematica has a PrimeQ function, which appears to be slow ...
2
votes
0answers
110 views

Displaying primes as a 3D array of spheres

I am currently learning my way through Mathematica and have stumbled upon a strange problem. It is asking me to implement PrimeQ into ...
3
votes
2answers
137 views

FactorInteger over UFDs

How can I factor 'integers' over other quadratic number fields (not just gaussian integers). For instance, how could I factor $7 = (3 + ω)(2 − ω)$ over Eisenstein integers ($ω = \frac{-1+ I ...
14
votes
4answers
2k views

Semi prime numbers

The high school textbook I am using has the example of semi-prime numbers. They wanted students to find (by "perspiration") all the semi-prime numbers less than $50$ (for a question on set theory). ...
3
votes
1answer
169 views

Faster Solve for Fermat 4n+1 conjecture

Assuming that Fermat 4n+1 conjecture (each prime of the form 4n+1 is the sum of two squares) is true then I like to solve the ...
0
votes
0answers
42 views

Limits of PrimeNu [duplicate]

Is there any way to find distinct prime factors for very large numbers using Prime and/or PrimePi that exceeds the ...
1
vote
0answers
33 views

Internals of Prime function [duplicate]

Does anyone knows how exactly Prime works ? For example how Prime[1000000000] is calculated ? The only information I found was ...
6
votes
2answers
320 views

Memory management and speed for Fast GCD

Let's say that we have some $300\,\text{K}$ digits (arbitrary function) and want to trial factor with $100{,}000{,}000$ first prime numbers. ...
1
vote
1answer
187 views

How to represent very long integers with at-most-8-digit(base-10) short integers with * and +

I need an algorithm in Mathematica, which can represent any very long integer, prime or not, into the the product operation "*" and sum "+" forms by short integers (not more than 8 decimal digits). ...
8
votes
4answers
305 views

Generate PrimePower counting function

Is there a way to generate a counting function for prime powers - i.e. to create a similar function to PrimePi, but including prime powers. The following will, of ...
0
votes
0answers
241 views

Hurwitz-Lerch transcendent

I want to compute the following sum over primes: $$\sum\limits_{p \text{ prime}}\sum\limits_{k=1}^\infty(\log(p^k))\left(\frac{1}{2p^k} - \Phi[-1,1,p^k]\right),$$ where $\Phi[z,s,a]$ is the ...
2
votes
0answers
111 views

Double sum over primes [duplicate]

Can anyone tell me the value of the sum $$\sum_{p\in \mathcal{P}}\sum_{n=1}^{\infty}\frac{\log (p^n)}{2}\left[\,p^{-n}-\psi\left(\frac{p^n+2}{2}\right)+\psi\left(\frac{p^n+1}{2}\right)\right].$$ ...
-1
votes
2answers
210 views

How to print prime numbers [closed]

I want to know how can I print out a list of prime numbers. Should I use For, Do, If, ...
10
votes
5answers
549 views

Double series over primes

I'm very curious if the following double series over primes has a closed form: $$\sum_{k \in \mathcal{P}}\sum_{n \in \mathcal{P}}\frac{1}{k\;n(k+n)^2}$$ where $\mathcal{P}$ denotes the set of all ...
11
votes
5answers
901 views

How can I simulate this animation of checking for prime numbers?

I can only implement a very simple one, I want to make my code look like that. Any better ideas? ...
4
votes
1answer
326 views

How does Mathematica calculate the nth prime?

When I enter Prime[2000000000000], the two-trillionth prime, Mathematica gives 61427839512211 for the answer after several ...
8
votes
3answers
516 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: ...
14
votes
2answers
432 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: ...
13
votes
2answers
380 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 ...
5
votes
1answer
399 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 ...
8
votes
1answer
201 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, ...
1
vote
1answer
439 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 ...
34
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 ...