Prime numbers are natural numbers greater than 1 not divisible by any smaller number other than 1. This tag is intended for questions about, related to, or involving prime numbers.

learn more… | top users | synonyms

1
vote
1answer
116 views

Digit wise modulo for calculating power function for very very large positive integers

I am writing a code to calculate $P^Q$ where $P$, $Q$ are positive integers which can have number of digits up to $100000$. I want the result as $r = P^Q \pmod{10^9+7}$, where $10^9+7$ is a prime ...
1
vote
2answers
64 views

Median primes and cryptography

I've been considering something involving median numbers. If an integer is directly in the middle of two integers, is it possible to accurately extrapolate what two it is between? Can a prime be in ...
1
vote
0answers
51 views

Sequence of primes by concatenating digits in a given base.

Given a base, $b$ is there is a sequence $\lbrace a_n\rbrace_{n\geq 0}$ where $a_k \in \lbrace 1,2\cdots, b-1\rbrace$so that the sequence: $$b_n:= \sum_{k=0}^n a_kb^k$$ is a sequence of primes ...
4
votes
1answer
170 views

Squeezing $\pi(x)$ out of $\psi(x)$

Can $\pi(x)$ be written in terms of $\psi(x)$? I can only seem to approximate it: $$ \pi(x)\approx\sum_{n=1}^{\infty}\left[\dfrac{\mu(n)}{n}\left(\dfrac{1}{\log(x^{1/n})}\left(\psi(x^{1/n})-x^{1/n}+\...
2
votes
0answers
58 views

A Question Related to Zsigmondy's Theorem

I am wondering if there is a way to prove the following statement, which bears some resemblance to Zsigmondy's Theorem. I am not sure if the statement is true, but it seems as though it should be. ...
6
votes
1answer
340 views

Meaning of Rays in Polar Plot of Prime Numbers

I recently began experimenting with gnuplot and I quickly made an interesting discovery. I plotted all of the prime numbers beneath 1 million in polar coordinates such that for every prime $p$, $(r,\...
4
votes
1answer
126 views

Why is $p_n\sim\sum_{k=1}^{n}\log(p_k)$?

Why is $$ p_n\sim\sum_{k=1}^{n}\log(p_k) $$ where $p_n$ is the $n$th prime? In addition, is it true that $$ n\log\left(\dfrac{\sum_{k=1}^{n}\log(k)}{\log(\log(n))}\right) $$ is a better ...
3
votes
0answers
103 views

Cramér's Model - “The Prime Numbers and Their Distribution” - Part 4

Following a previous question (here you'll find an introduction): A paper by Maier which refutes Cramer's Model suggests we should replace the heuristic "$\Bbb P(n\in\mathcal P)=1/\log n$" with $$\...
1
vote
0answers
89 views

Fast algorithm for generating consecutive primes larger than N

I'm looking for a fast algorithm to generate primes larger than a random 4096 bit number $N$. I know about the Sieve of Atkin, but AFAIK it can only be used to find all primes up to a certain limit. ...
1
vote
2answers
159 views

RSA - finding $p$ and $q$

If the public key $(e,n)$ and the private key $(d,n)$ are known, how can I find the $p$ and $q$ primes by the easiest way? When $n$ and $\varphi(n)$ are given was easy to solve, but this issue I can't ...
1
vote
0answers
39 views

Cramér's Model - “The Prime Numbers and Their Distribution” - Part 3

Following a previous question (here you'll find an introduction): The book states that almost surely $$\pi_S(x+y)-\pi_S(x)=\mathrm{li}(x+y)-\mathrm{li}(x)+O(\sqrt y)$$ as soon as $y/(\log x)^2\to\...
2
votes
0answers
53 views

Cramér's Model - “The Prime Numbers and Their Distribution” - Part 2

Following a previous question (here you'll find an introduction): The book states that using the convergence of the binomial distribution towards the Poisson distribution, it's easy to show that $$|\{...
11
votes
0answers
450 views

Cramér's Model - “The Prime Numbers and Their Distribution” - Part 1

I was reading "The Prime Numbers and Their Distribution" by Gérald Tenenbaum and Michel Mendès France, the section about Cramér's Model, and I couldn't prove a couple of results. I would like to start ...
2
votes
1answer
88 views

Finding an $n$ such that $n^2 \equiv -1 \mod p$

What is an efficient algorithm to find the first number $n$ such that $n^2 \equiv -1 \mod p$ for a prime $p$, if such an $n$ exists? Is there anything better than the brute-force approach up to $p-1 \...
0
votes
1answer
66 views

Probability with Primes

What is the probability that a positive divisor of $8748$ million is the product of exactly $20$ non-distinct primes? To try and solve this question I split up $8748$ into $2^8 \cdot 5^6 \cdot 3^7 $ ...
1
vote
4answers
237 views

Why didn't Fermat provide proofs of his theorems?

Apparently Fermat stated but didn't provide proofs of various theorems named after him, including Fermat's little theorem, Fermat's theorem on sums of two squares, Fertmat's polygonal number theorem, ...
1
vote
2answers
64 views

Can't understand source of constant for prime counting function:

Consider the prime counting function $$ \pi(x) = \ the \ number \ of \ primes \ less \ than \ or \ equal \ to \ x$$ It is well known due to the sieve eratosthenes that given an integer $n$ and the ...
37
votes
6answers
3k views

Is $2^{218!} +1$ prime?

Prove that $2^{218!} +1$ is not prime. I can prove that the last digit of this number is $7$, and that's all. Thank you.
0
votes
1answer
174 views

Let $x = 2441921$. Factor $x$ into a product of primes.

Let $x = 2441921$. Factor $x$ into a product of primes. I found that: $1519^2 −x=−134560= −2^5 ·5 · 29^2$ and $1541^2 −x=−67240= −2^3 · 5 · 41^2$. I am trying to figure out what to do from here. ...
-4
votes
1answer
84 views

Please give feedback to this solution.

Consider the number $n= 2^{1000000000000000000000000000000000} +1$. Suppose that it is known that none of the numbers $1 < k < n - 10^{6}$ divides $n$. Does it follow that $n$ is a prime ...
1
vote
3answers
114 views

First index of number in that arithmetic progression which is a multiple of the given prime number

I have a prime number $p$, an arithmetic progression starting at $a$ with common difference $d$. How to find the first index of a term in that arithmetic progression which is a multiple of the given ...
28
votes
6answers
7k views

Are all prime numbers finite?

If we answer false, then there must be an infinite prime number. But infinity is not a number and we have a contradiction. If we answer true, then there must be a greatest prime number. But Euclid ...
0
votes
1answer
43 views

Probability and Prime Numbers

What is the probability that a positive divisor of 8748 million is the product of exactly 20 non-distinct primes?
0
votes
2answers
91 views

Represent a prime number $p$ congruent to $1$ $\pmod{3}$ by a sum of a square and $3$ times a square

I want to have a proof of the fact that each prime number is the sum of a square and three times a square (Euler). Context I read the answer to my former question about the number of points on an ...
2
votes
0answers
88 views

Are there any primes that are never a factor of a Carmichael number?

Is there a prime number $p$ that $p > 2$, and in which $p$ is a never a factor of any Carmichael number $C_n$: (p ∤ $C_n$) Extended this to all numbers $m$, instead of just $p$, will prove the $p$...
15
votes
4answers
794 views

Why do repunit primes have only a prime number of consecutive $1$s?

Repunit primes are primes of the form $\frac{10^n - 1}{9} = 1111\dots11 \space (n-1 \space ones)$. Each repunit prime is denoted by $R_i$, where $i$ is the number of consecutive $1$s it has. So far, ...
1
vote
4answers
103 views

$p$ prime, $p\mid a^k \Rightarrow p^k\mid a^k$

Suppose $p$ is a prime and $a$ and $k$ are positive integers. Prove that if $pa^k$ then $p^k\mid a^k$. I have already proven that if $a,b,n\in\mathbb{N}$ and if $a^n\mid b^n$, then $a\mid b$. I tried ...
1
vote
1answer
101 views

Length of smallest repunits divisible by primes

I want to prove this statement from Wikipedia: It was found very early on that for any prime p greater than 5, the period of the decimal expansion of 1/p is equal to the length of the smallest ...
4
votes
0answers
63 views

Computing question: A quadratic which gives primes [closed]

This is about Project Euler Problem 27. The question is: Considering quadratics of the form $n^2 + an + b$, where $\lvert a \rvert < 1000$ and $\lvert b \rvert < 1000$ Find the product ...
2
votes
2answers
77 views

Prove that every non-prime natural number $ > 1$ can be written in the form of $n+(n+2)+(n+4)+…+(n+2m) = p$

I'm trying to prove that every non-prime natural number greater than $1$ can is equal to a sum of consecutive even or odd numbers. This can be resumed in : « $p,m,n \in ℕ$» , «$p > 1$» , «$n > ...
0
votes
2answers
161 views

Congruence modulo primes or in a polynomial ring over ${\rm GF}(2)$

Let $p, q$ be primes. Then the linear congruence $$ap \equiv r\pmod q$$ can be solved for $a\in\mathbb Z$ and will have a unique solution for each value of $r$ such that $0\leqslant a<q$. Am I ...
30
votes
2answers
4k views

Are weird numbers more rare than prime numbers?

By taking a look at the first few weird numbers: $$(70, 836, 4030, 5830, 7192, 7912, 9272, 10430)$$ It is certain that prime numbers occurs more often within this range of numbers. But are weird ...
6
votes
5answers
294 views

What is the proof to the fact that all prime numbers are 1 above or below a 6 multiple? [duplicate]

I was just having an argument with my friend and I dunno how we got here. But he suddenly said all primes are 1 above or below a multiple of 6. At first I tried a lot of primes but couldn't disprove ...
0
votes
1answer
31 views

Divisibility of $a^p-r$ and $a^q-r$ by the primes $p,q$

Let $p, q$ be prime and $a$ some positive integer such that $a = pq + r$ where $r$ is the remainder. Show that $p \mid a^p – r$ and $q \mid a^q – r$. Example: $p = 3$ and $q = 5$, $a = 17$ and $r = ...
3
votes
1answer
142 views

Siamese Twin primes

Can someone edit my answer to this question whether I am answering the question or I am not? The question is Let us say that two prime numbers $p$ and $q$ are siamese twins if $|p-q|=1$. List all ...
3
votes
1answer
82 views

If $p$ is prime, prove that $\exists k\in\lbrace 5,-7,9,-11,..\rbrace$ in $(\mathbb{Z}/p\mathbb{Z})^*$ so that the Legendre symbol $(\frac{k}{p})=-1$

The BSPW primality test, when given $p$ as input, iterates over $k \in \lbrace 5,-7,9,-11,...\rbrace$ as long as the Legendre symbol $(\frac{k}{p})=1$. If $(\frac{k}{p})=0$, it returns "composite". So ...
4
votes
0answers
71 views

Are large prime numbers kept secret? [duplicate]

I've read several times that modern cryptography is based on the fact that multiplying two primes is easy, whereas getting the prime factorization of a random big integer is very hard. (see here) ...
3
votes
1answer
110 views

Showing that if $p$ is prime, then $(p^4 + 4)$ can't be prime

I want to show that if $p$ is prime, then $(p^4 + 4)$ can't be prime. I guess Fermat's little theorem may help, but I can't figure out how to use it for the proof. Can anyone point me in the right ...
1
vote
1answer
72 views

Limit of Sum $\sum \frac{p(k+1) - p(k)}{p(k)^2}$ ? (corrected)

This is a re-post with my (corrected) earlier typo in red as a reminder. The question is about $$(A)\hspace{10mm}\lim_{n \to \infty} \sum_{k=\color{red}2}^{n} \frac{p(k +1) - p(k)}{p(k)^2} = \...
30
votes
1answer
700 views

Very tight prime bounds

Is it possible that $$\left|\operatorname{li}(n)-\sum_{k=1}^{\lfloor\log(n)\rfloor}\dfrac{\pi(n^{1/k})}{k}-\log(2)-\dfrac{1}{2}\right|<\dfrac{2\sqrt{n}}{e\log(n)}?$$ Since $$ \sum_{k=1}^{\...
2
votes
1answer
148 views

Are there infinitely many prime numbers? [duplicate]

I will post my own answer below. That should not deter others from answering. There are many ways to prove this.
1
vote
1answer
85 views

Sizes of Blocks of Consecutive Integers Divisible by at Least One Prime Less than or Equal to $r$.

Let $f(r)$ be the largest integer such that there exists a block of $f(r)$ consecutive integers each divisible by some prime that is less than or equal to $r$. For example, $f(2)=1$ because it is ...
6
votes
1answer
449 views

Identity for frequency of integers with smallest prime(n) divisor

An identity for A038110 and A038111: $$ \frac{\phi(e^{\psi(p_{n}-1)})}{e^{\psi(p_{n})}}=\frac{\prod _k^{n-1} \left(1-\frac{1}{p_k}\right)}{p_n}, $$ where $\psi(\cdot)$ is the second Chebyshev function ...
3
votes
0answers
101 views

An Inequality with Prime Numbers

Let $m\geq 8$ be an integer, and let $q$ be the smallest prime that is greater than $m$. Let $p$ be a prime that satisfies $q\leq p<q^2$, and let $p_0$ be the smallest prime such that $p_0q>p^2$....
7
votes
1answer
187 views

Prove $18080108080 \sum_{k=0}^{1560-1} 10^{10k}+1$ is prime

I saw this fact on twitter: I would like to know how one would show this number is prime. Is there an elementary way to show that this number is prime? Is there a simplified primality testing ...
1
vote
0answers
136 views

Fast check of safe primes or Sophie Germain primes

If $p=2q +1$ with $p,q$ prime then $p$ is called safe prime and $q$ is a Sophie Germain prime. I want a faster algorithm for a safe prime test than doing two primality checks for $p$ and $q$. In http:...
0
votes
1answer
41 views

Existence of at least one prime for all sequences in the family of sequences

Prove or disprove that for a fixed $n \in N$, there exists at least one prime among the integers of the form $2^{k}n+2^k-1$ for an arbitrary $k \in N$.
2
votes
0answers
66 views

Prime bounds under RH

Continuing from here, since $$ \sum_{k=1}^{\lfloor\log(n)\rfloor}\dfrac{\pi(n^{1/k})}{k}=\operatorname{li}(n)-\sum_{k=1}^{\infty}2\ \Re\left(\operatorname{Ei}\left(\rho_k\log\left(n\right)\right)\...
2
votes
2answers
387 views

Visualization of Eratosthenes’ sieve

In otherwise great paper on prime numbers, I found following visualization of Eratosthenes’ sieve: I found it somewhat scary and confusing. Is there any better visualization of Eratosthenes’ sieve ...
0
votes
2answers
133 views

$9n^2-4$ only generates one prime? Why?

Instead of doing the work I was supposed to be doing, I played around with some numbers, and I noticed that for $n\in\mathbb{N}$, $9n^2-4$ only seems to generate a prime for $n=1$. Can anyone ...