Bases: sage.symbolic.function.BuiltinFunction
Dickman’s function is the continuous function satisfying the differential equation
with initial conditions for
. It is useful in estimating the frequency
of smooth numbers as asymptotically
where is the number of
-smooth
numbers less than
.
ALGORITHM:
Dickmans’s function is analytic on the interval
for each integer
. To evaluate at
, a power series is recursively computed
about
using the differential equation stated above.
As high precision arithmetic may be needed for intermediate results
the computed series are cached for later use.
Simple explicit formulas are used for the intervals [0,1] and [1,2].
EXAMPLES:
sage: dickman_rho(2)
0.306852819440055
sage: dickman_rho(10)
2.77017183772596e-11
sage: dickman_rho(10.00000000000000000000000000000000000000)
2.77017183772595898875812120063434232634e-11
sage: plot(log(dickman_rho(x)), (x, 0, 15))
Graphics object consisting of 1 graphics primitive
AUTHORS:
REFERENCES:
Approximate using de Bruijn’s formula
which is asymptotically equal to Dickman’s function, and is much faster to compute.
REFERENCES:
EXAMPLES:
sage: dickman_rho.approximate(10)
2.41739196365564e-11
sage: dickman_rho(10)
2.77017183772596e-11
sage: dickman_rho.approximate(1000)
4.32938809066403e-3464
This function returns the power series about used
to evaluate Dickman’s function. It is scaled such that the interval
corresponds to x in
.
INPUT:
EXAMPLES:
sage: f = dickman_rho.power_series(2, 20); f
-9.9376e-8*x^11 + 3.7722e-7*x^10 - 1.4684e-6*x^9 + 5.8783e-6*x^8 - 0.000024259*x^7 + 0.00010341*x^6 - 0.00045583*x^5 + 0.0020773*x^4 - 0.0097336*x^3 + 0.045224*x^2 - 0.11891*x + 0.13032
sage: f(-1), f(0), f(1)
(0.30685, 0.13032, 0.048608)
sage: dickman_rho(2), dickman_rho(2.5), dickman_rho(3)
(0.306852819440055, 0.130319561832251, 0.0486083882911316)
Bases: sage.symbolic.function.BuiltinFunction
TESTS:
sage: latex(hurwitz_zeta(x, 2))
\zeta\left(x, 2\right)
sage: hurwitz_zeta(x, 2)._sympy_()
zeta(x, 2)
Bases: sage.symbolic.function.GinacFunction
Riemann zeta function at s with s a real or complex number.
INPUT:
If s is a real number the computation is done using the MPFR library. When the input is not real, the computation is done using the PARI C library.
EXAMPLES:
sage: zeta(x)
zeta(x)
sage: zeta(2)
1/6*pi^2
sage: zeta(2.)
1.64493406684823
sage: RR = RealField(200)
sage: zeta(RR(2))
1.6449340668482264364724151666460251892189499012067984377356
sage: zeta(I)
zeta(I)
sage: zeta(I).n()
0.00330022368532410 - 0.418155449141322*I
It is possible to use the hold argument to prevent automatic evaluation:
sage: zeta(2,hold=True)
zeta(2)
To then evaluate again, we currently must use Maxima via sage.symbolic.expression.Expression.simplify():
sage: a = zeta(2,hold=True); a.simplify()
1/6*pi^2
TESTS:
sage: latex(zeta(x))
\zeta(x)
sage: a = loads(dumps(zeta(x)))
sage: a.operator() == zeta
True
sage: zeta(1)
Infinity
sage: zeta(x).subs(x=1)
Infinity
Bases: sage.symbolic.function.GinacFunction
Derivatives of the Riemann zeta function.
EXAMPLES:
sage: zetaderiv(1, x)
zetaderiv(1, x)
sage: zetaderiv(1, x).diff(x)
zetaderiv(2, x)
sage: var('n')
n
sage: zetaderiv(n,x)
zetaderiv(n, x)
sage: zetaderiv(1, 4).n()
-0.0689112658961254
sage: import mpmath; mpmath.diff(lambda x: mpmath.zeta(x), 4)
mpf('-0.068911265896125382')
TESTS:
sage: latex(zetaderiv(2,x))
\zeta^\prime\left(2, x\right)
sage: a = loads(dumps(zetaderiv(2,x)))
sage: a.operator() == zetaderiv
True
The Hurwitz zeta function , where
and
are complex.
The Hurwitz zeta function is one of the many zeta functions. It defined as
When , this coincides with Riemann’s zeta function.
The Dirichlet L-functions may be expressed as a linear combination
of Hurwitz zeta functions.
EXAMPLES:
Symbolic evaluations:
sage: hurwitz_zeta(x, 1)
zeta(x)
sage: hurwitz_zeta(4, 3)
1/90*pi^4 - 17/16
sage: hurwitz_zeta(-4, x)
-1/5*x^5 + 1/2*x^4 - 1/3*x^3 + 1/30*x
sage: hurwitz_zeta(7, -1/2)
127*zeta(7) - 128
sage: hurwitz_zeta(-3, 1)
1/120
Numerical evaluations:
sage: hurwitz_zeta(3, 1/2).n()
8.41439832211716
sage: hurwitz_zeta(11/10, 1/2).n()
12.1038134956837
sage: hurwitz_zeta(3, x).series(x, 60).subs(x=0.5).n()
8.41439832211716
sage: hurwitz_zeta(3, 0.5)
8.41439832211716
REFERENCES:
Completed function that satisfies
and has zeros at the same points as the
Riemann zeta function.
INPUT:
If s is a real number the computation is done using the MPFR library. When the input is not real, the computation is done using the PARI C library.
More precisely,
EXAMPLES:
sage: zeta_symmetric(0.7)
0.497580414651127
sage: zeta_symmetric(1-0.7)
0.497580414651127
sage: RR = RealField(200)
sage: zeta_symmetric(RR(0.7))
0.49758041465112690357779107525638385212657443284080589766062
sage: C.<i> = ComplexField()
sage: zeta_symmetric(0.5 + i*14.0)
0.000201294444235258 + 1.49077798716757e-19*I
sage: zeta_symmetric(0.5 + i*14.1)
0.0000489893483255687 + 4.40457132572236e-20*I
sage: zeta_symmetric(0.5 + i*14.2)
-0.0000868931282620101 + 7.11507675693612e-20*I
REFERENCE: