Chebyshev Function Calculator
Prime sums
- The first Chebyshev function theta(x) adds ln p over the primes p up to x; the second, psi(x), also counts prime powers.
- Sum ln p over the 4 primes up to 10 to get theta(x) = 5.3471.
- Add ln p once more for every prime power p^k up to 10 - squares, cubes and higher - and psi(x) rises to 7.8320.
- The prime number theorem is the statement that both theta(x) / x and psi(x) / x tend to 1, which is why these two sums carry the whole distribution of the primes.
Before the prime number theorem was proved, Chebyshev built the two functions that still carry its proof: theta(x), the sum of ln p over all primes p up to x, and psi(x), the same sum extended over prime powers. Weighting primes by their logarithms turns the jagged business of counting primes into two smooth, steadily growing functions - and the theorem itself becomes the statement that theta(x)/x and psi(x)/x both tend to 1.
This calculator evaluates both functions exactly at your x, alongside pi(x) and the two ratios. The values to hold in mind are at x = 100: theta(100) = 83.7284 and psi(100) = 94.0453. Note the order - theta is the smaller one, because psi adds the prime-power contributions on top. Swapping the two is the classic error with these functions, and the calculator's side-by-side layout is designed to prevent it.
At x = 10 the values are small enough to verify by hand: the primes are 2, 3, 5, 7, so theta(10) = ln 2 + ln 3 + ln 5 + ln 7 = 5.3471, and psi(10) adds ln 2 twice more (for 4 and 8) and ln 3 once more (for 9), reaching 7.8320.
Worked examples
Chebyshev functions at x = 10
(10)
| theta(x), the first Chebyshev function | 5.3471 |
| psi(x), the second Chebyshev function | 7.8320 |
| pi(x), the number of primes up to x | 4 |
| theta(x) / x and psi(x) / x | 0.5347 and 0.7832 |
Chebyshev functions at x = 100
(100)
| theta(x), the first Chebyshev function | 83.7284 |
| psi(x), the second Chebyshev function | 94.0453 |
| pi(x), the number of primes up to x | 25 |
| theta(x) / x and psi(x) / x | 0.8373 and 0.9405 |
Chebyshev functions at x = 50
(50)
| theta(x), the first Chebyshev function | 40.9602 |
| psi(x), the second Chebyshev function | 49.4854 |
| pi(x), the number of primes up to x | 15 |
| theta(x) / x and psi(x) / x | 0.8192 and 0.9897 |
Two sums over primes
Theta is the simpler sum: one term ln p for each prime up to x. Psi generalizes it by counting prime powers: each prime p contributes ln p once for every power p^k that does not exceed x. The prime 2 contributes at 2, 4, 8, 16, 32, ...; the prime 3 at 3, 9, 27, ...; and so on. Equivalently, psi(x) is the sum of the von Mangoldt function Lambda(n) over all n up to x - the sibling page on this site evaluates Lambda itself.
The hand-checkable case x = 10 shows both sums being built. Theta gathers ln 2 + ln 3 + ln 5 + ln 7 = 5.3471 over the four primes. Psi adds the prime powers 4 = 2^2, 8 = 2^3 and 9 = 3^2, contributing ln 2, ln 2 and ln 3 again, for a total of 7.8320. Nothing else up to 10 is a prime power, so the account closes there.
- theta(x) = sum of ln p over primes p <= x
- psi(x) = sum of ln p over prime powers p^k <= x, each counted once per power
- theta(10) = 5.3471, psi(10) = 7.8320, pi(10) = 4
- psi(x) is also the partial sum of the von Mangoldt function
theta vs psi - which is bigger
Psi is always at least theta, because its sum includes every term of theta's sum plus the prime-power extras. At x = 100 the gap is substantial: theta(100) = 83.7284 against psi(100) = 94.0453 - the squares, cubes and higher powers of primes up to 100 contribute almost 10.32 between them. At x = 50 the values are theta = 40.9602 and psi = 49.4854.
The warning bears repeating because the swap is so easy: from memory, 'the Chebyshev function at 100 is about 94' sounds right for theta and is wrong - 94.0453 is psi. Theta at 100 is 83.7284. The calculator prints both, labelled, with their ratio to x beside each, so the pair can be read off without ambiguity.
- theta(100) = 83.7284 - the smaller value
- psi(100) = 94.0453 - includes prime powers
- theta(50) = 40.9602, psi(50) = 49.4854
- psi >= theta always, with equality only below 4
The road to the prime number theorem
The prime number theorem - pi(x) is asymptotic to x / ln x - is equivalent to each of the statements theta(x) ~ x and psi(x) ~ x. Chebyshev himself proved the ratios are bounded between positive constants, the first real progress towards the theorem, and the full result fell in 1896 to Hadamard and de la Vallee Poussin. The ratios this calculator reports are the theorem made visible: at x = 100, theta(x)/x = 0.8373 and psi(x)/x = 0.9405, both climbing towards 1 with the slow, uneven gait the subject is known for.
Psi is usually the working function in proofs, because it connects directly to the zeta function through its Dirichlet series, while theta is closer to pi(x) itself. That the two are asymptotically equal - their difference is of lower order - is one of the first lemmas in any treatment, and the x = 100 gap of about 10.3 on values of about 90 shows the convergence is real but unhurried.
| x | theta(x) | psi(x) | theta(x)/x | psi(x)/x | pi(x) |
|---|---|---|---|---|---|
| 10 | 5.3471 | 7.8320 | 0.5347 | 0.7832 | 4 |
| 50 | 40.9602 | 49.4854 | 0.8192 | 0.9897 | 15 |
| 100 | 83.7284 | 94.0453 | 0.8373 | 0.9405 | 25 |
psi and the lcm connection
One identity makes psi tangible: e raised to psi(x) equals lcm(1, 2, ..., x), the least common multiple of all integers up to x. At x = 10 this says psi(10) = ln 2520, and indeed lcm(1..10) = 2520 while ln 2520 = 7.8320 - the calculator's value. The identity works because lcm collects each prime power up to x exactly once at its highest power, mirroring psi's bookkeeping.
This is more than a curiosity: it gives psi an elementary meaning independent of analysis - psi(x) measures the logarithmic size of the lcm - and it is the form in which Chebyshev's estimates are often first proved. If you want to test the identity at another point, compare psi(10) here against the lcm: 2520 is small enough to check by hand, and the agreement is exact, not approximate.
What Chebyshev himself proved
Chebyshev did not prove the prime number theorem, but he fenced it in. In 1852 he showed that psi(x)/x eventually stays between two explicit constants, about 0.92129 and 1.1056 - the ratio cannot collapse to 0 or drift away, so pi(x) has the right order of magnitude. After centuries in which even the growth rate of the primes was conjectural, those two constants were a landmark: the theorem was suddenly a matter of closing a 20 percent gap, not of finding the right shape.
The ratios from this calculator sit inside Chebyshev's fence at every tabulated point: at x = 100, psi(x)/x = 0.9405, comfortably above his lower constant 0.92129. The fence took another four decades to close to the limit 1, and the modern explicit versions of the theorem - inequalities valid for all x, not just eventually - descend directly from Chebyshev's approach of estimating these two sums.
It is also worth knowing which function appears in his original estimates: psi, the one with prime powers included, because its connection to factorials and the lcm makes it the tractable one. Theta's asymptotic equality with x follows from psi's, via the bound on their difference - another reason the pair is always presented together, as on this page.
A practical note on computing the pair: the calculator sums ln p over primes up to x for theta, and for psi it adds, for each prime, the contributions of its powers - equivalently summing the von Mangoldt function. Both sums are sieved in one pass, so values at the tabulated points (10, 50, 100) are instant and exact to the printed precision. The functions are step functions - constant between primes, jumping at each prime or prime power - which is why their ratios to x move in small discrete steps rather than gliding.
- Chebyshev (1852): psi(x)/x eventually between about 0.92129 and 1.1056
- At x = 100 the ratio 0.9405 already sits inside his fence
- The full limit 1 was proved in 1896 by Hadamard and de la Vallee Poussin
Explicit bounds you can use
Beyond the limit statement, the Chebyshev functions carry fully explicit inequalities, proved in the Rosser-Schoenfeld tradition and sharpened since: for all sufficiently large x, psi(x) is within a few percent of x, with the allowed error shrinking as x grows and the bounds stated as exact inequalities rather than asymptotics. These are the bounds that make prime-counting estimates rigorous in computations - for instance, verifying that a stated pi(x) value is consistent, or bounding the least prime in an arithmetic progression in an applied argument.
The calculator's small-x values sit inside the same framework: psi(100)/100 = 0.9405, already within 6 percent of the limit 1 at the tiny argument 100. Chebyshev's own 1852 constants (0.92129 and 1.1056) bracket it, as they must - the fence he built still contains every value the function has taken since.
- Modern explicit bounds keep psi(x)/x within a few percent of 1 for large x
- psi(100)/100 = 0.9405 - inside Chebyshev's 1852 fence of 0.92129 to 1.1056
- Explicit psi bounds underpin rigorous prime-counting estimates
FAQs
What is the Chebyshev function theta(x)?
theta(x) is the sum of ln p over all primes p up to x. At x = 100 it equals 83.7284; at x = 10, over the primes 2, 3, 5, 7, it equals 5.3471.
What is the difference between theta(x) and psi(x)?
psi(x) also counts prime powers, adding ln p for every p^k <= x, so psi is always at least theta. At x = 100, psi = 94.0453 against theta = 83.7284 - the two are easily swapped from memory, and theta is the smaller.
What is psi(10)?
7.8320 - exactly ln 2520, because e^psi(x) equals lcm(1, ..., x) and lcm(1..10) = 2520. The prime powers 4, 8 and 9 supply the extra terms beyond theta(10) = 5.3471.
How do the Chebyshev functions relate to the prime number theorem?
The prime number theorem is equivalent to theta(x)/x and psi(x)/x both tending to 1. At x = 100 the ratios are 0.8373 and 0.9405 - visibly on their way, at the theorem's characteristically slow pace.
What is theta(50)?
40.9602, with psi(50) = 49.4854. The gap of about 8.5 between them is the total contribution of prime squares, cubes and higher powers up to 50.
Why do analysts use logarithms of primes?
Weighting each prime by ln p turns products into sums and makes prime powers contribute evenly, which lets theta and psi track pi(x) closely: pi(100) = 25, while psi(100)/100 is already 0.9405 on its way to 1.