Defining the Prime Gap function

  • Context: Undergrad 
  • Thread starter Thread starter MevsEinstein
  • Start date Start date
  • Tags Tags
    Function Gap Prime
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
24 replies · 3K views
MevsEinstein
Messages
124
Reaction score
36
TL;DR
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)##?
 
  • Wow
Likes   Reactions: nuuskur
Mathematics news on Phys.org
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.
 
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?
 
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
 
  • Like
Likes   Reactions: Janosh89
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
more info https://www.tedsundstrom.com/mathematical-reasoning-3

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

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

“An introduction to mathematical reasoning”
https://sites.math.washington.edu/~conroy/m300-general/ConroyTaggartIMR.pdf
more info https://sites.math.washington.edu/~conroy/2019/m300-win2019/index.htm

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

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

📚📝
 
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 give my advanced and intersted high school students these links.
I'm not even in high school yet :-p
 
Last edited:
  • Wow
Likes   Reactions: Janosh89
MevsEinstein said:
I'm not even in high school yet :-p
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:
  • Haha
Likes   Reactions: 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.