# prime-numbers's questions - English 1answer

104 prime-numbers questions.

### 8 Does Mathematica have a twin prime equivalent of PrimePi?

5 answers, 302 views functions number-theory prime-numbers
Well, it's all there in the title! I'd like to be able to plot the number of twin primes =<x. Is there an inbuilt function that can do this?

### 1 Asymptotic density of twin primes gives wrong result in Mathematica [closed]

One can compute the amount of twin primes below a positive integer $n$ by using the Mathematica command (taken from OEIS A001097): ...

### 2 Is a probabilistic primality test implemented in Mathematica?

1 answers, 104 views random prime-numbers
Imagine that I need to verify that a specific integer, like $n = 10^{1347}+3049$ is prime.ProvablePrimeQ takes a lot of time, and, even if it will eventually work ...

### Why do complex elements of $R(x)$ cancel? [migrated]

Edit of original post: I've been noodling around with non-trivial zeroes of the Riemann zeta function, and in particular with the expression $$\sum_{\rho}R(x^\rho)$$ where $R(x)$ is Riemann's ...

### 1 How can I compute how many primes of this kind are up to $N$?

In the following link: https://oeis.org/A079796/b079796.txt we can see the first 10,000 prime numbers $p$ with the property that both $(3p)^2 + p^2 + 3^2$ and $(3p)^2 - p^2 - 3^2$ are primes ...

### 2 Showing the difference between Primes

I create a list of primes in table form... How do I generate and display the difference between the prime numbers in sequence? ...

### 4 How to ask WolframAlpha to find 'x such that p=32*x+1 is prime'

I want to find prime $p$ in form of $p=32 x+1$ How can I ask WolframAlpha for such $x$ that will fulfil this equation? EDIT: let's say that $100$ or $n$ solutions is enough for me EDIT2: I need x's ...

### Making Prime number

i know there is a Command in Matematica to get prime number, but i want to break down the code,here is what i got ...

### 18 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 ...

### 5 Question about how to speed up Mathematica code

5 answers, 192 views number-theory prime-numbers
When looking at the Minimal Goldbach prime partition point {p,q} for each n; where n=10^i and i = 2,3,4,...,10; I notice that these points reside in an interval with center n/2 and radius 250: ...

### 2 Displaying primes as a 3D array of spheres

1 answers, 325 views graphics3d prime-numbers
I am currently learning my way through Mathematica and have stumbled upon a strange problem. It is asking me to implement PrimeQ into ...

### Generate a prime number satisfying a condition

1 answers, 87 views number-theory prime-numbers
Building on the same context of this question Is it possible to enforce constraints on the properties of the generated prime? For example, I'm trying to find a prime $p$ in the range specified in the ...

### 2 Generate a prime number in a range with fixed $n$ most significant bits

1 answers, 97 views prime-numbers binary
I'm new to Mathematica so my question might be trivial. How do I generate a $200-bit$ prime with the condition that the 10 most significant bits in its binary representation are equal to some binary ...

### 1 factorization of integer into two parts with specific prime factors

I would like to write a Mathematica code to decompose an integer into two or more parts with primes in special intervals. For instance, I want to decompose $m=\binom{n}{k}$ into two parts U and V ...

### Listing products of prime powers

Given a positive integer $n$, what is the code to list $2^{a_2}3^{a_3}\cdots p^{a_p}$, where $a_i\ge 0$ are integers, with respect to the lexicographic ordering on $(a_2,a_3,\ldots, a_p)$? The only ...

### 2 Product over several previous primes

2 answers, 59 views prime-numbers products
I'd like to evaluate $$\prod_p\left(1-\frac1p\right)$$ over the $k$ largest previous primes $p\le n/2$, where $n$ is the parameter. E.g., if $n=20$ and $k=3$, I'd like the product to be over the 3 ...

### Question about how to use NestWhileList

0 answers, 48 views number-theory prime-numbers
I start with:n = 2228; m = n/2; PreviousPrime[n_] := NextPrime[n, -1]I use NestList to build the following list: ...

### 8 Goldbach Partition

4 answers, 587 views number-theory prime-numbers partitions
I want to check the Goldbach conjecture for a big number of $n$, but I don't know how to define this in Mathematica. These are my questions: Find a pair of primes $(p,q)$ for every even integer $n$, ...

### 1 Number of primes between two integers x and y (with x < y and excluding x and y)

1 answers, 96 views number-theory prime-numbers
There is a formula given at the bottom of the following webpage: https://math.stackexchange.com/questions/288747/how-to-find-number-of-prime-numbers-between-two-integers to calculate the number of ...

### 16 How can FactorInteger be so slow if PrimeQ is fast?

4 answers, 1.166 views number-theory prime-numbers
My 8th grade son had a homework problem to find a prime factor of $99!-1$. I thought to be clever/lazy and used FactorInteger[99!-1], but it takes forever. ...

### 5 How to sum over primes

1 answers, 882 views summation prime-numbers
Apologies in advance for the simplicity of the question, but I can't fathom how to write the following as a sum in Mathemaitca: \begin{align} &\sum_{p}^{a}\sum_{n}^{b}\text{expression} \end{align}...

### 4 Sum indexed by Primes [duplicate]

2 answers, 102 views summation number-theory prime-numbers
How can I express a sum indexed by primes in Mathematica? Two examples that I am interested in are (1) where the primes go from $p=2$ to, say, $p=17$. (2) It would also be useful to have the sum ...

### 1 Summing over Prime Factors (without repetition)

Wolfram Mathworld (http://mathworld.wolfram.com/SumofPrimeFactors.html) describes a function sopfr(n), the sum of prime factors, which I currently need. This code doesn't work when I insert it in ...

### 1 How can I speed up Mathematica calculations? [closed]

I am using Mathematica 11.1 to deterministically test the primality of a set of very large numbers (i.e. more than 1000 digits). Some of these calculations (understandably) take a lot of time (several ...

### Efficiently get primes in range

I first had an iterative method, which ran sufficiently fast: ...

### 4 How to generate primes of the form 8n+1?

3 answers, 565 views list-manipulation prime-numbers
I'm trying to extract from the list of the first one hundred primes those which have the form 8n+1. I have tried using Select but this just gives me an empty list: ...

### 2 List of Coprimes

1 answers, 484 views number-theory prime-numbers
Is there a way to generate a list of parametrized length, say $L$, of integers which are relatively prime among them? I would like to take into account their word-length as well, so for example the ...

### 2 Replacing all primes with 0 [closed]

I am attempting to utilise the Conditionfunction to replace all primes in the list by a 0. Here are my codes: ...

### 1 How to make substitution using parallel ranges? [closed]

1 answers, 53 views equation-solving prime-numbers
Example : $$y=x^2+x+1,$$ where 1st range: $x=$ 1 to 1,000,000; 2nd range: $x=$ 1,000,001 to 2,000,000; 3rd range: $x=$ 2,000,001 to 3,000,000.

### Receiving no output when executing this code

2 answers, 96 views error recursion prime-numbers
Today I was trying to compute the value of a function in one point ($f(3594641)$) using Mathematica. The main difficulty it has is that it requires both calculating primorials (product of primes) and ...

### 2 What are the limits of the Prime-functions? [duplicate]

0 answers, 119 views implementation-details prime-numbers
Will Prime and PrimePi test up to 3 * 10^12? Where can I find the limits for these funtions? ...

### 9 Finding large primes

I'm quite new to Mathematica and I am trying to find large prime numbers that can be written using only the digits 0, 1, 2 and 3 and more than half of these digits have to be 0. For example 1000 and ...

### How to plot the number of Mersenne Primes lower than a given input?

1 answers, 118 views plotting number-theory prime-numbers
I would like to plot the number of Mersenne primes (primes of the form $2^n-1$) lower than a given input. I am totally noob to mathematica and I do not know where to start from. I have tried to ...

### 3 Exact formula for the $n$ th prime

1 answers, 119 views summation prime-numbers
There is an exact $n$th prime number formula from mathworld A double sum for the nth prime pn is p_n=1+\sum_{k=1}^{2(\lfloor n\ln n\rfloor+1)}\Biggl[1-\Biggl\lfloor\frac{\sum_{j=2}^k 1+\lfloor s(...

### Some information about PrimeQ function

In Mathematica there is a built-in function called PrimeQ which tests given input as True or ...

### 1 How can I know the number of solutions of an equation involving prime numbers?

1 answers, 49 views plotting prime-numbers
I have to admit that I am totally noob to mathematica, and I have a question for which I have not found any easy-to-understand answer about. How could I calculate the number of prime numbers of a ...

### 16 Next highly composite number?

R language has this function 'nextn' (link) which computes the next highly composite number greater than a given one, which is used to find the optimal padding size for the subsequent FFT operation. ...

### I need some help with this algorithm

1 answers, 96 views performance-tuning error prime-numbers
I'm quite new to Mathematica yet, so there's probably a lot of not-so-subtle problems (indeed the algorithm isn't even running yet). My goal with this algorithm is to input an integer $n$ and get all ...

### Powers of prime factors of a positive integer $n$ in “Mathematica”?

I would like to find the powers of a prime in the unique prime factorization of an $n$. I want a function $f[n,p]$ such that $n,p$ are given and I need to know what the power of $p$ is. For instance ...

### 12 Accuracy of PrimeQ function

Using PrimeQ in Mathematica 10 on integers up to $2\cdot 10^{5717}$ the function appears to work. The Documentation for Mathematica 5 says that ...

### 5 Manipulate Slider to take its values from primes

3 answers, 184 views manipulate prime-numbers slider
How do I make the slider values in Manipulate be values that are prime numbers? Many thanks for any assistance. Firstly, many thanks for all your considered and rapid responses. It really is very ...

### -1 Generate list of first 100 prime number? [closed]

1 answers, 885 views list-manipulation prime-numbers
I know how to generate a list of prime numbers up to a limit, but how would I generate the first 100 prime numbers in a list?

### 2 Brute force evidence of possible proof of twin prime conjecture

Trying to avoid shelling out hundreds of dollars so I'm using what I can for free online. This is what I've come up with so far: https://dl.dropboxusercontent.com/u/76769933/TwinPrimes%203Podd.cdf ...

### 3 What is the form of a PrimalityProving`PrimeQCertificate?

1 answers, 35 views number-theory prime-numbers
I understand the format of a proof of compositeness of an integer produced by PrimeQCertificate: it's well-documented that ...

### 3 Plot prime numbers in spiral form, in the clockwise direction

1 answers, 582 views plotting prime-numbers
I want to plot first 100 Prime numbers in circular format (on circular orbit) in Mathematica. How can i do this?