bernoulli(n)
Indicated the number of terms in the Bernoulli series to generate.
The Bernoulli numbers [B(0), B(1), ..., B(n)]
.
Bernoulli numbers B0..Bn (inclusive).
>>> from scipy.special import bernoulli, zeta
... bernoulli(4) array([ 1. , -0.5 , 0.16666667, 0. , -0.03333333])
The Wikipedia article () points out the relationship between the Bernoulli numbers and the zeta function, B_n^+ = -n * zeta(1 - n)
for n > 0
:
>>> n = np.arange(1, 5)
... -n * zeta(1 - n) array([ 0.5 , 0.16666667, -0. , -0.03333333])
Note that, in the notation used in the wikipedia article, bernoulli
computes B_n^-
(i.e. it used the convention that B_1
is -1/2). The relation given above is for B_n^+
, so the sign of 0.5 does not match the output of bernoulli(4)
.
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.special._basic.bernoulli
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them