# Defining the Prime Gap function

• I
• MevsEinstein
In summary, the conversation focused on creating a function ##R(x)## that gives the gap between the largest two primes less than or equal to ##x##. The function was defined using the property $$\pi(x+R(x))=\pi(x)+1$$ and it was discussed how to solve for ##R(x)##. The conversation then shifted to discussing resources for learning about analytic number theory and mathematical reasoning, with several links and book recommendations provided.
MevsEinstein
TL;DR Summary
So I was creating a function ##R(x)## such that gives you the gap between the largest two primes less than or equal to ##x##. I was trying to define it using the prime counting function, but I ran into problems
Hi PF!

I created a function ##R(x)## that gives the gap between the largest two primes less than or equal to ##x##. To define it, I used this property: $$\pi(x+R(x))=\pi(x)+1$$ Which is true since the ##x## distance between ##\pi(x)## and ##\pi(x)+1## is ##R(x)##. If we solve for ##R(x)## we get $$R(x) = \pi^{-1}(\pi(x)+1)-x$$ But ##\pi^{-1}(x)## isn't defined since ##\pi(x)## is a step function. Is there any other non-problematic way I can define ##R(x)##?

nuuskur
Have you read "Introduction to analytic number theory" by Apostol?

drmalawi said:
Have you read "Introduction to analytic number theory" by Apostol?
No my library doesn't have it and my dad doesn't want me to buy books. Does it help?

I asked Wolfram to find the inverse function of ##\frac{x}{\ln (x)}## (which is an approximation for ##\pi (x)##) and it gave me ##-xW(-\frac{1}{x})##. So an approximation for ##R(x)## is ##-(\pi(x)+1)W(-\frac{1}{\pi(x)+1}) - x##

fresh_42 said:
But it is only a function for ##x>0.##
That's fine since we are only looking at positive integers.

MevsEinstein said:
That's fine since we are only looking at positive integers.
Yes, but you got ##W(-1/x)## which is a negative argument. If ##x>0## then ##-1/x < 0.##

fresh_42 said:
If ##x>0## then ##-1/x < 0.##
OH. Well, the inverse prime function actually doesn't exist since ##\pi(x)## is a step function. So now what? Maybe if we think of ##\pi^{-1}## as a set of numbers and take the smallest one then we are fine?

MevsEinstein said:
take the smallest one then we are fine?
Why don't you check for yourself and see if your R(x) gives desired result

drmalawi said:
Why don't you check for yourself
I don't know how to write the smallest value of ##\pi^{-1}(x)## in set notation. But I did go ahead and graph a few values of ##R(x)##: https://www.desmos.com/calculator/vacrq5jxg1

Janosh89
## \pi^{-1}(x) = \min \left\{ y \in \mathbb{N} \, : \, \pi(y) = x \right\} ##

drmalawi said:
## \pi^{-1}(x) = \min \lbrace y \in \mathbb{N} \, : \, \pi(y) = x \rbrace ##
Thanks! So $$R(x)= \min \lbrace y \in \mathbb{N} \, : \, \pi(y) = \pi(x) + 1 \rbrace - x$$

MevsEinstein said:
This is why PF is amazing the people keep giving out resources. TYSM!

I give my advanced and intersted high school students these links. The focus is on teaching how to read, construct and write proofs. Enjoy

“Mathematical reasoning”
https://scholarworks.gvsu.edu/cgi/viewcontent.cgi?article=1024&context=books

“Book of proof”
https://www.people.vcu.edu/~rhammack/BookOfProof/Main.pdf

“A gentle introduction to the art of mathematics”
https://github.com/osj1961/giam/blob/master/GIAM.pdf?raw=true

“An introduction to mathematical reasoning”
https://sites.math.washington.edu/~conroy/m300-general/ConroyTaggartIMR.pdf

“Proofs and concepts - the fundamentals of abstract mathematics”
https://batch.libretexts.org/print/Finished/math-23870/Full.pdf

“Elementary Foundations: An Introduction to Topics in Discrete Mathematics”
https://batch.libretexts.org/print/Finished/math-83395/Full.pdf

MevsEinstein said:
This is why PF is amazing the people keep giving out resources. TYSM!

drmalawi said:
## \pi^{-1}(x) = \min \lbrace y \in \mathbb{N} \, : \, \pi(y) = x \rbrace ##
Thanks! So $$R(x)= \min{y \in \mathbb{N}$$

drmalawi said:
I'm not even in high school yet

Last edited:
Janosh89
MevsEinstein said:
I'm not even in high school yet
Looks to me you think you are in graduate school :)
MevsEinstein said:
I am getting dizzy
hehe yeah, there is lot of stuff, but most of those follow the same format. Pick one and work it through, then pick another and see if there is anything new there. If you master the second pick, you can just browse through the other ones table of contents and see if there is anything there you have not encountered or mastered earlier.
MevsEinstein said:
Thanks! So $$R(x)= \min{y \in \mathbb{N}$$
no idea why you are typing this again
MevsEinstein said:
Thanks! So $$R(x)= \min \lbrace y \in \mathbb{N} \, : \, \pi(y) = \pi(x) + 1 \rbrace - x$$

Last edited by a moderator:
MevsEinstein
I thought I didn't put the definition for R(x) so I typed it again on accident

If you're going to use the approximation ##f(x)=x/ln(x)##, then you can just go all the way.

##f'(x)= \frac{\ln(x)-1}{\ln(x)^2}##
An interpretation of this is if you increase ##x## by ##\epsilon##, then ##f(x)## increases by approximately ##f'(x)\epsilon##. So to increase ##f(x)## by 1, you pick ##\epsilon = 1/f'(x)##.

This can be an arbitrarily bad approximation, for example it will never tell you when there are twin primes.

## 1. What is the Prime Gap function?

The Prime Gap function is a mathematical function that calculates the difference between two consecutive prime numbers. It is denoted as g(n) and is defined as g(n) = p(n+1) - p(n), where p(n) is the nth prime number.

## 2. How is the Prime Gap function used?

The Prime Gap function is used to study the distribution and patterns of prime numbers. It helps in understanding the gaps between prime numbers and their relationship with other mathematical concepts such as twin primes and prime constellations.

## 3. Can the Prime Gap function be negative?

Yes, the Prime Gap function can be negative. This occurs when the difference between two consecutive prime numbers is negative, indicating that the first prime number is larger than the second one.

## 4. Is there a limit to the size of the Prime Gap function?

There is no known limit to the size of the Prime Gap function. As the value of n increases, the size of the prime gap can also increase. However, it is believed that the size of the prime gap eventually becomes smaller as n approaches infinity.

## 5. What is the largest known prime gap?

The largest known prime gap is 70,000,000. This was discovered in 2014 by mathematicians Tomás Oliveira e Silva, Siegfried Herzog, and Silvio Pardi using a computer program. It is the gap between the 284,724,609th and 284,724,631st prime numbers.

• General Math
Replies
6
Views
992
• General Math
Replies
4
Views
849
• General Math
Replies
2
Views
795
• General Math
Replies
2
Views
1K
• General Math
Replies
2
Views
1K
• General Math
Replies
9
Views
1K
• Calculus
Replies
4
Views
893
• Calculus and Beyond Homework Help
Replies
3
Views
502
• General Math
Replies
5
Views
1K
• General Math
Replies
17
Views
4K