# Numbering Primes

Is there any formula or function to express a prime as the nth prime?

For example, if I have "7", I can say it's the 4th prime number. (2,3,5,7)

If I have a large prime number, like 8161 or something, how can I find which numbered prime it is (without going through and counting all the primes)?

Note by Akshaj Gopalakrishnan
11 months, 3 weeks ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

I know the answer but this comment section is too small for my proof.

Yours sincerely, Fermat or rather Percy(Perseus) Jackson

@Vinayak Srivastava, @Frisk Dreemurr, @Yajat Shamji @Páll Márton LOLOLOLOLOLOL

@Akshaj Gopalakrishnan - Don't mind my antics, here's a link :)

- 11 months, 3 weeks ago

There are some function to calculate approximately how many prime numbers are in a given intervall. But there is no fomrula to calculate the nth prime number. Maybe a good dream yet :) We are waiting for @Percy Jackson lol

- 11 months, 3 weeks ago

formula and not fomrula

- 11 months, 3 weeks ago

??? wdymn

- 11 months, 3 weeks ago

What does it mean?

- 11 months, 3 weeks ago

Yeah. But brute force is faster

- 11 months, 3 weeks ago

Really??? What is the 345th prime number Mr.@Páll Márton ???

- 11 months, 3 weeks ago

I don't know. But if you are so clever use your formulas and tell us lol

- 11 months, 3 weeks ago

Ok, its 2333 :) @Páll Márton

- 11 months, 3 weeks ago

Ahmmm. To use these formulas is possible only with computers. You are right, it can be faster, but the complexity is still big. (I think)

- 11 months, 3 weeks ago

Yes, very complex. Only a great mind such as mine can calculate that, but fail to understand why 1+1 = 2 lol :)

- 11 months, 3 weeks ago

$\large \text{nth prime}=1+\displaystyle\sum_{m=1}^{2^n}[[\cfrac{n}{1+\pi(m)}]^{\frac{1}{n}}]$

- 11 months, 3 weeks ago

Congratulation!!!

- 11 months, 3 weeks ago

So if n=345, then $m_{max}=2^{325}$?

- 11 months, 3 weeks ago

Copycat Páll lol

- 11 months, 3 weeks ago

I just wrote it in a more readable form to show you brute force is faster

- 11 months, 3 weeks ago

Ok, whatever..................

- 11 months, 3 weeks ago

but i can't prove it, because as I said -

I know the answer but this comment section is too small for my proof.

Yours sincerely, Perseus Jackson

- 11 months, 3 weeks ago

lmao

- 11 months, 3 weeks ago

I gave a link. Mr. Sir pinky(sierpinsky) has made a formula :) @Páll Márton

- 11 months, 3 weeks ago

Oh wow that's complicated. Thanks! That helps!

- 11 months, 3 weeks ago

No prob :)

- 11 months, 3 weeks ago

lmgtfy lol

- 11 months, 3 weeks ago

lmgtfy always doesn't help

- 11 months, 3 weeks ago

It did now :)

- 11 months, 3 weeks ago

I wasn't sure what to ask google lol. I don't remember what exactly I googled, but I just got algorithms to find the nth prime.

- 11 months, 3 weeks ago

Have you tried the prime-counting function?:

$\pi(x)$

- 11 months, 3 weeks ago

That's exactly what I needed! Thanks!

- 11 months, 3 weeks ago

No problem!

Here is an example:

$\pi(4) = 1, 2, 3, 4 = 2, 3 = 2$

- 11 months, 3 weeks ago

What is that?

- 11 months, 3 weeks ago

The prime-counting function?

- 11 months, 3 weeks ago

I don't know what is that

- 11 months, 3 weeks ago

Go to Wikipedia and search prime-counting function.

- 11 months, 3 weeks ago