# 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
2 months, 1 week 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.
• Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

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:

Have you tried the prime-counting function?:

$\pi(x)$

- 2 months, 1 week ago

That's exactly what I needed! Thanks!

- 2 months, 1 week ago

No problem!

Here is an example:

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

- 2 months, 1 week ago

What is that?

- 2 months, 1 week ago

The prime-counting function?

- 2 months, 1 week ago

I don't know what is that

- 2 months, 1 week ago

Go to Wikipedia and search prime-counting function.

- 2 months, 1 week ago

lmgtfy lol

- 2 months, 1 week 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.

- 2 months, 1 week ago

lmgtfy always doesn't help

- 2 months, 1 week ago

It did now :)

- 2 months, 1 week ago

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 :)

- 2 months, 1 week ago

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

- 2 months, 1 week ago

No prob :)

- 2 months, 1 week 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

- 2 months, 1 week ago

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

- 2 months, 1 week ago

formula and not fomrula

- 2 months, 1 week ago

Yeah. But brute force is faster

- 2 months, 1 week ago

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

- 2 months, 1 week ago

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

- 2 months, 1 week 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

- 2 months, 1 week ago

lmao

- 2 months, 1 week ago

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

- 2 months, 1 week 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)

- 2 months, 1 week ago

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

- 2 months, 1 week ago

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

- 2 months, 1 week ago

Copycat Páll lol

- 2 months, 1 week ago

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

- 2 months, 1 week ago

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

- 2 months, 1 week ago

Congratulation!!!

- 2 months, 1 week ago

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

- 2 months, 1 week ago

??? wdymn

- 2 months, 1 week ago

What does it mean?

- 2 months, 1 week ago