Fortunate Number Calculator
Number Theory
- Multiply the first 3 primes (2, 3, 5) to get the primorial 30.
- A Fortunate number is the smallest integer m greater than 1 such that primorial + m is prime. The scan tests m = 2, 3, 4, ... in order.
- The first m that works is 7: 30 + 7 = 37, which is prime, and every smaller m from 2 upward leaves a composite.
- The Fortunate numbers for n = 1 to 8 run 3, 5, 7, 13, 23, 17, 19, 23. Reo Fortune conjectured that every Fortunate number is itself prime; no counterexample is known.
Take the product of the first n primes - the primorial, written p# - and ask a simple question: how far do you have to count upward before you hit a prime? The distance to that prime, provided it is more than 1, is the Fortunate number for that primorial, named after the New Zealand anthropologist and mathematician Reo Fortune, who studied them.
This calculator builds primorials for n from 1 to 8 and scans upward from m = 2 to find the first value that makes p# + m prime. The answers are small but not obvious: 3, 5, 7, 13, 23, 17, 19, 23.
Fortunate numbers carry a genuine open problem. Every one ever computed is itself prime, and Fortune conjectured this is always so - a statement simple enough for a schoolchild to understand and still unproved today.
Worked examples
Third primorial
(3)
| Fortunate number | 7 |
| Primorial p# | 30 |
| Prime reached (p# + m) | 37 |
| Primes in the primorial | 3 |
Fifth primorial
(5)
| Fortunate number | 23 |
| Primorial p# | 2,310 |
| Prime reached (p# + m) | 2,333 |
| Primes in the primorial | 5 |
Seventh primorial
(7)
| Fortunate number | 19 |
| Primorial p# | 510,510 |
| Prime reached (p# + m) | 510,529 |
| Primes in the primorial | 7 |
Primorials first
The primorial of the first n primes multiplies them together: the first three primes give 2 x 3 x 5 = 30, the first five give 2,310, and the first seven give 510,510. Primorials grow ferociously - each new prime at least doubles the product - which is why this calculator stops at n = 8.
A primorial itself is never prime. The interesting question is what happens just above it: because p# is divisible by every prime up to the nth, the numbers immediately above it are guaranteed composite for a stretch - p# + 2 is divisible by 2, p# + 3 by 3, and so on. The Fortunate number measures exactly how long that forced drought lasts.
The scan for m
The scan starts at m = 2 - m = 1 is excluded by definition, a historical choice that keeps the sequence clean. Each candidate p# + m is tested until the first prime appears. For the third primorial the drought is short: 32, 33, 34, 35 and 36 are all composite, and 37 is prime, so the Fortunate number is 7.
For the fifth primorial the wait is longer. The scan passes 22 composite values before 2,310 + 23 = 2,333 turns out prime, giving a Fortunate number of 23. The seventh primorial needs m = 19, reaching the prime 510,529.
Fortune's conjecture
Look at the answers again: 3, 5, 7, 13, 23, 17, 19, 23. Every one is prime. Fortune conjectured that this is a theorem waiting for a proof - that the first prime above a primorial always sits at a prime distance. Computations have verified it for primorials far beyond the eighth, without a single exception.
The conjecture sits in the same family as other deceptively simple prime-gap statements. A proof would need to show that every composite distance m fails for a structural reason, and nobody has found the structure. Until someone does, each new primorial checked is another small experiment in the conjecture's favour.
Why the drought has a floor
There is a neat lower bound hiding in the definition. Every m up to the nth prime itself is guaranteed to fail, because p# + m then shares the factor m's smallest prime. So the Fortunate number for the primorial of the first n primes always exceeds the nth prime - for n = 5, the answer 23 duly exceeds 11.
That is also why the answers trend upward with n, though irregularly: 23 appears for both n = 5 and n = 8, while n = 6 drops back to 17. Prime gaps are like that - forced on average, capricious in detail.
Working with primorials
Primorials turn up wherever the first primes act together: in Euclid's proof of the infinitude of primes, in the construction of prime gaps, and in sieve arguments throughout analytic number theory. The Fortunate construction is essentially Euclid's argument made quantitative - Euclid adds 1; Fortune asks how far past 1 you must go.
This calculator's primality tests use trial division, which is entirely adequate at these sizes: the largest value tested, for n = 8, is under ten million, whose square root is a little over three thousand.
The sequence at a glance
Indexed by n, the Fortunate numbers begin 3, 5, 7, 13, 23, 17, 19, 23 - sequence A005235 in the OEIS. The non-monotonic dip at n = 6 is a good reminder that these are empirical facts about primes, not outputs of a smooth formula.
If you enjoy this flavour of problem, the natural next stops are prime gaps after factorials, Euclid numbers (p# + 1 and their factors), and the Jacobsthal function, which formalizes the longest forced drought after any integer, not just primorials.
Euclid's shadow
Fortune's construction is Euclid's proof of the infinitude of primes with a measuring stick attached. Euclid multiplies the known primes and adds 1 to force a new prime into existence somewhere; Fortune asks the sharper question - how far above the primorial must you travel before a prime actually shows itself, not merely must exist?
The gap between 'a prime must exist' and 'here is the first one' is where most of prime number theory lives. The Fortunate number is a tiny, computable window into that gap, small enough to hold in your hand and connected to the same mysteries as the largest prime gaps ever found.
What changes with n
Stepping n from 1 to 8, the primorial explodes from 2 to 9,699,690 while the Fortunate number merely wanders between 3 and 23. That contrast is the phenomenon: the forced composite stretch after a primorial grows only slowly - roughly like the square of the nth prime by deep theorems on prime gaps - while the primorial itself grows exponentially.
It also means the calculator's small table is deceptive about difficulty. Verifying Fortune's conjecture for the 100th primorial is not a matter of a bigger scan of the same kind; the primality proofs for numbers at that scale are industrial operations.
A party-trick corollary
Because every m up to the nth prime is excluded, the Fortunate number gives a lower bound on the prime gap following a primorial for free. School presentations love this: multiply the first five primes, and you can promise the class - before any checking - that the first prime above 2,310 hides at a distance beyond 11. The scan then delivers 23, comfortably beyond the promise.
Bounds you can prove in one line and answers that still surprise you are a rare combination, and they are why this small sequence keeps its place in textbooks.
Computing beyond this page
Serious Fortunate-number hunting uses probable-prime tests and sieving across the forced composite stretch, because the primorials involved have thousands of digits and trial division is out of the question. The structure of the search, though, is the one on this page: build p#, walk upward, test.
The walk's length is itself studied - the maximal prime gap below a primorial relates to the Jacobsthal function, whose growth has been bounded by deep work on prime gaps. A school-level construction thus opens a door into research-level analytic number theory in about three steps.
Fortunate numbers that repeat
The value 23 appears twice in the first eight terms, and 5, 7, 13 and 19 recur further out. Repetition is expected on heuristic grounds - small prime distances are common - yet each repeat is a tiny surprise, since the primorials involved share almost nothing but their construction.
Whether every prime appears as a Fortunate number infinitely often is unknown and probably deep. The sequence keeps its mysteries proportionate to its simplicity, which is the hallmark of a good elementary problem.
FAQs
What is a Fortunate number?
For the primorial p# (the product of the first n primes), it is the smallest integer m greater than 1 such that p# + m is prime.
What is the Fortunate number for the third primorial?
The third primorial is 30, and the answer is 7, because 30 + 7 = 37 is the first prime above 30 reached this way.
Are Fortunate numbers always prime?
Every known one is prime, and Fortune conjectured it always holds - but the conjecture is still unproved.
What is a primorial?
The product of the first n primes, written p#. The first five primes give 2 x 3 x 5 x 7 x 11 = 2,310.
What is the Fortunate number for 2,310?
23 - the scan reaches the prime 2,333 before any smaller m works.
Why can't the answer be small?
Every m up to the nth prime is guaranteed composite above p#, so the Fortunate number always exceeds the nth prime.
Who was Reo Fortune?
A New Zealand anthropologist and mathematician who defined these numbers and conjectured they are always prime.
What is the Fortunate number for n = 1?
The first primorial is 2, and 2 + 3 = 5 is the first prime reached with m over 1, so the Fortunate number is 3.
What is the largest primorial this calculator builds?
For n = 8 the primorial is 2 x 3 x 5 x 7 x 11 x 13 x 17 x 19 = 9,699,690, and its Fortunate number is 23.