logint

Logarithmic integral li(x).

Category: Mathematics > Mathematical Functions

Syntax

Y = logint(x)

Evaluates li(x), the integral of 1/log(t) from 0 to x.

Description

li(x) is defined by integral(1/log(t), t, 0, x), with a principal value across the singularity at t = 1. It grows like x/log(x) and approximates the prime counting function pi(x) better than that simple ratio does.

It is related to the exponential integral by li(x) = Ei(log(x)), and li(0) = 0.

Input arguments

x
Real or complex scalar or array.

Output arguments

Y
Values of li(x), with the size of x.

Example

Values and prime counting

logint([2 10 100])
primes_below_100 = numel(primes(100))
Output
ans = 1×3

    1.0452    6.1656   30.1261
primes_below_100 = 25

See also

expint sinint primes zeta