Preprint
Article

This version is not peer-reviewed.

Classical Constants Generated from Prime Numbers: A Pedagogical Bridge Between the Discrete and the Continuous

Submitted:

14 November 2025

Posted:

18 November 2025

You are already at the latest version

Abstract
We present several constructions of classical constants such as e, π, and the golden ratio φ using only prime numbers or prime–based sequences (for instance, prime indices in the Fibonacci and Lucas sequences). Our goal is not numerical efficiency but to highlight the pedagogical connection between prime arithmetic and the analytic nature of fundamental constants. We show how the Prime Number Theorem and Euler’s product for the Riemann zeta function allow us to reinterpret e and π as “prime-generated” limits or products, and we suggest classroom activities for calculus, real analysis, and introductory number theory courses.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

In the teaching of calculus and real analysis, the constants
e , π , φ = 1 + 5 2
are typically introduced via power series, limits of elementary functions, or geometric interpretations. On the other hand, in elementary number theory courses one introduces the set of prime numbers
2 , 3 , 5 , 7 , 11 , 13 , ,
together with functions such as π ( x ) (the prime counting function) and sequences such as the Fibonacci sequence.
The central message of this work is that these two apparently separate narratives can be conceptually connected in a very appealing way: it is possible to define or approximate classical constants using only prime numbers, either in the form of limits, infinite products, or sequences indexed by primes. Although some of these constructions are not competitive as numerical methods, they are very valuable as pedagogical tools to illustrate the bridge between the discrete (primes) and the continuous (limits, derivatives, integrals).
In the following sections we present:
  • limits that generate e from the distribution of primes,
  • products over primes that lead to π ,
  • the golden ratio φ obtained through Fibonacci and Lucas numbers evaluated at prime indices,
  • and a pedagogical discussion with suggested activities.
Standard references for analytic number theory and the distribution of primes, including the Prime Number Theorem and Euler products, are Apostol [1] and Hardy–Wright [2]; Finch’s monograph [3] surveys many classical constants and their representations from a unified perspective.

2. Preliminaries: Primes and Classical Functions

We denote by p n the n-th prime number and by π ( x ) the prime-counting function:
π ( x ) = # { p prime : p x } .
The Prime Number Theorem states that
π ( x ) x log x as x ,
and, equivalently,
p n n log n as n .
We do not use deep technical versions of this result; we only need its most basic asymptotic form, which is enough to justify the limits that appear in the following sections (see, for instance, [1,4]).
We also introduce the Chebyshev functions
θ ( x ) = p x log p , ψ ( x ) = p k x log p .
For the pedagogical purposes of this article it suffices to know that θ ( x ) x as x , and that the identity
ζ ( s ) = n = 1 1 n s = p 1 1 p s
(for ( s ) > 1 ) links primes directly to series over the integers.

3. The Constant e from Prime Numbers

3.1. A Conceptual Construction: n n / p n e

Let p n denote the n-th prime. Consider the sequence
a n = n n / p n .
Taking logarithms, we obtain
log a n = n p n log n .
By the Prime Number Theorem, p n n log n , so that
n p n log n n n log n log n = 1 .
Therefore log a n 1 and, consequently:
Proposition 1. 
We have
lim n n n / p n = e .
This construction is conceptually elegant: it defines e as the limit of an expression that involves only integers and the positions of the primes. However, the convergence is extremely slow. Table 1 shows some illustrative values, where we can see that even for n = 10 5 the value is far from e.
Here e 2.7182818 . The table is useful to discuss in class the difference between existence of a limit and speed of convergence.

3.2. A Product Construction with Faster Decay

Proposition 1 shows that e is “encoded” in the distribution of primes. However, it is natural to look for expressions that mimic the structure of products over primes that appear in ζ ( 2 ) and that also converge relatively fast.
Let
S = p 1 p 2 ,
which is convergent because it is a subseries of n 1 1 / n 2 . We define, purely algebraically,
e = exp ( 1 ) = exp p 1 S p 2 .
Rewriting this as a product, we obtain
e = p exp 1 S p 2 .
This suggests the sequence of partial products
E N = p p N exp 1 S p 2 ,
where p N is the N-th prime. Then we have:
Proposition 2. 
With the above notation,
lim N E N = e .
Moreover, the error in the exponent behaves, at first order, like
p > p N 1 S p 2 C p N
for some constant C > 0 , so that the convergence is of order 1 / p N .
Table 2 shows some typical values (assuming S 0.4522 ), where we can observe a faster convergence than in Table 1.
These tables allow us to compare, in the classroom, two different ways of “extracting” the same constant e from prime arithmetic.

4. The Constant π from Products over Primes

The case of π is more classical and is based on the value of the Riemann zeta function at s = 2 :
ζ ( 2 ) = n = 1 1 n 2 = π 2 6 .
On the other hand, Euler’s product formula gives (for ( s ) > 1 )
ζ ( s ) = p 1 1 p s ,
so that at s = 2 we obtain
π 2 6 = p 1 1 1 p 2 .
This allows us to write:
Proposition 3. 
We have
π = 6 p 1 1 1 p 2 = lim x 6 p x 1 1 1 p 2 .
If we define the partial product
π ( x ) = 6 p x 1 1 1 p 2
we obtain a monotonically increasing approximation to π . Table 3 illustrates some values for the first few primes.
Although the convergence is not immediate either, it is significantly better than in Table 1, and the comparison is quite instructive for students.

5. The Golden Ratio via Primes, Fibonacci, and Lucas

The Fibonacci sequence ( F n ) n 0 (see, e.g., [5]) is defined by
F 0 = 0 , F 1 = 1 , F n + 1 = F n + F n 1 ,
and the golden ratio is the limit
φ = lim n F n + 1 F n .
Binet’s formula gives
F n = φ n ψ n 5 , where ψ = 1 φ .
In particular, F n φ n / 5 .
Let p n be the n-th prime. We can use primes as a sampling tool:
Proposition 4. 
The following limits hold:
φ = lim n F p n + 1 F p n a n d φ = lim n F p n 1 / p n .
(Idea of the proof). 
Since p n as n , we simply note that
F p n + 1 F p n φ
is just the same convergence as F n + 1 / F n φ restricted to a subsequence (any subsequence of a convergent sequence converges to the same limit). For the second identity, from Binet’s formula we have
F p n φ p n 5 ,
so that
F p n 1 / p n φ p n 5 1 / p n = φ 1 5 1 / p n φ .
An analogous construction can be carried out with the Lucas sequence ( L n ) n 0 , defined by L 0 = 2 , L 1 = 1 , L n + 1 = L n + L n 1 , which satisfies L n φ n (see also [5]):
Proposition 5. 
Let p n be the n-th prime. Then
φ = lim n L p n + 1 L p n a n d φ = lim n L p n 1 / p n .
In these constructions, primes do not directly generate a product or a series, but they act as a selection tool: we keep only the Fibonacci or Lucas terms at prime indices and, nevertheless, the golden ratio reappears as a limit.

5.1. Combining π and φ with Products over Primes

A different approach, closer in spirit to Proposition 3, is to use the identity
φ = 2 cos π 5 .
If we define π ( x ) as in Proposition 3, that is,
π ( x ) = 6 p x 1 1 1 p 2
then
φ ( x ) = 2 cos π ( x ) 5 2 cos π 5 = φ ( x ) .
In compact notation:
Proposition 6. 
We have
φ = lim x 2 cos 1 5 6 p x 1 1 1 p 2 .
Table 4 illustrates some values of φ ( x ) obtained by truncating the product in π ( x ) at the first primes.
This example combines three didactic ideas:
  • products over primes,
  • trigonometry and continuous functions,
  • and the golden ratio as a geometric constant.

6. Pedagogical Discussion and Suggested Activities

In this section we outline some ways to use the previous constructions in the classroom.

6.1. Comparing Rates of Convergence

A first activity is to ask students to compare numerically different expressions for the same constant. For example, for e:
  • the classical definition e = lim n 1 + 1 n n ;
  • the limit e = lim n n n / p n ;
  • the partial product E N = p p N exp 1 S p 2 .
Using Table 1 and Table 2 one can discuss:
  • how fast each expression approaches e,
  • how many operations each method requires,
  • what information about primes is needed to evaluate them.
A second activity consists in doing the same for π and φ :
  • classical trigonometric formulas for π ,
  • the approximation via the prime product π ( x ) = 6 p x ( 1 p 2 ) 1 (Table 3),
  • and, from this, the approximation to φ via φ ( x ) = 2 cos ( π ( x ) / 5 ) (Table 4).

6.2. A Bridge Between Number Theory and Analysis

Another interesting pedagogical angle is to use these examples to tell a unified story:
  • Primes appear as the fundamental building blocks of arithmetic.
  • The zeta function, Euler products, and the Prime Number Theorem show how they are related to series and limits.
  • Analytical constants such as e, π , and φ can be viewed as continuous shadows of discrete structures.
Depending on the level of the course, one can adjust the rigor:
  • In a calculus course, Proposition 1 can be presented as a simple application of the limit log a n 1 .
  • In a real analysis or number theory course, one can explore in more depth the ideas behind the Prime Number Theorem and Euler’s product (see [1,2,4]).

6.3. Open Explorations

Finally, these constructions can lead to small guided “research projects”. For example:
  • Define new constants by combining products over primes (for instance, inspired by the twin prime constant) and study their numerical convergence.
  • Investigate what happens if one replaces the sequence of all natural numbers by a sequence indexed only by primes in other known limits.
  • Explore variants of Propositions 4 and 5 by restricting the indices to special subsets of primes (for example, twin primes, Sophie Germain primes, etc.).

7. Conclusions

We have shown that it is possible to construct classical constants such as e, π , and φ from expressions involving only primes, either via limits, products, or sequences indexed by primes. Although some of these formulations are not efficient for numerical computation, they provide fertile ground for pedagogical activities connecting number theory and analysis.
In particular, the proposed viewpoint can help to:
  • visualize the Prime Number Theorem as a description of the rate at which certain limits approach e,
  • reinterpret Euler’s product for ζ ( 2 ) as a machine that generates π from primes,
  • and see the golden ratio as a robust limit that persists even when we sample the Fibonacci and Lucas sequences only at prime indices.
We believe that these ideas can serve as the basis for didactic material, lecture notes, or expository articles that motivate students by showing the deep interplay between discrete objects (primes, recursive sequences) and analytic constants, in the spirit of [3,5].

References

  1. T. M. Apostol, Introduction to Analytic Number Theory, Springer, 1976.
  2. G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed., Oxford University Press, 2008.
  3. S. R. Finch, Mathematical Constants, Cambridge University Press, 2003.
  4. B. Mazur and W. Stein, Prime Numbers and the Riemann Hypothesis, Cambridge University Press, 2016.
  5. T. Koshy, Fibonacci and Lucas Numbers with Applications, 2nd ed., John Wiley & Sons, 2019.
Table 1. Approximation of e via a n = n n / p n
Table 1. Approximation of e via a n = n n / p n
n p n a n = n n / p n a n e
10 29 2.212216 0.506066
100 541 2.342533 0.375749
1 000 7 919 2.392411 0.325871
10 000 104 729 2.409562 0.308720
100 000 1 299 709 2.424943 0.293339
Table 2. Approximation of e via the partial product E N
Table 2. Approximation of e via the partial product E N
N p N E N E N e
1 2 1.738131 0.980151
2 3 2.222213 0.496068
3 5 2.427722 0.290560
5 11 2.586629 0.131653
10 29 2.675204 0.043078
20 71 2.703108 0.015174
50 229 2.714353 0.003929
100 541 2.716828 0.001454
Table 3. Approximation of π via partial products over primes
Table 3. Approximation of π via partial products over primes
Number of primes π ( x ) π ( x ) π
1 ( p = 2 ) 2.828427 0.313166
2 ( p = 2 , 3 ) 3.000000 0.141593
3 ( p = 2 , 3 , 5 ) 3.061862 0.079730
5 ( p 11 ) 3.106455 0.035137
10 ( p 29 ) 3.130243 0.011349
20 ( p 71 ) 3.137599 0.003994
30 ( p 113 ) 3.139431 0.002162
Table 4. Approximation of φ via φ ( x ) = 2 cos ( π ( x ) / 5 )
Table 4. Approximation of φ via φ ( x ) = 2 cos ( π ( x ) / 5 )
Number of primes φ ( x ) φ ( x ) φ
1 ( p = 2 ) 1.688443 0.070409
2 ( p = 2 , 3 ) 1.650671 0.032637
3 ( p = 2 , 3 , 5 ) 1.636573 0.018539
5 ( p 11 ) 1.626255 0.008221
10 ( p 29 ) 1.620698 0.002664
20 ( p 71 ) 1.618973 0.000939
30 ( p 113 ) 1.618542 0.000508
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2025 MDPI (Basel, Switzerland) unless otherwise stated