Catalan¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
Catalan
is Catalan's constant, with numerical value ~= 0.915966.
NumericQ[Catalan]
is True, and D[Catalan, x] is 0. N[Catalan, prec]
Notes
Catalan is the sum over k \>= 0 of (-1)^k (2 k + 1)^-2. It is a mathematical constant: it has attributes Constant and Protected, evaluates it to any precision.Examples (5)¶
Every input below was run against the current Mathilda build and its output recorded.
Applications (5)¶
In[1]:= N[Catalan]
Out[1]= 0.915966
In[2]:= N[Catalan, 40]
Out[2]= 0.91596559417721901505460351493238411077416
In[3]:= D[Catalan, x]
Out[3]= 0
In[4]:= NumericQ[Catalan]
Out[4]= True
In[5]:= N[8 Catalan, 30]
Out[5]= 7.32772475341775212043682811946
Implementation notes¶
Definition. Catalan is Catalan's constant G ≈ 0.9159655942, the alternating
sum Sum_{k>=0} (-1)^k (2 k + 1)^-2 (equivalently Beta[2], the Dirichlet beta
function at 2). It is a constant symbol: row
{ "Catalan", 0.9159655941…, fill_mpfr_catalan } of kConstants[] in
src/numeric.c supplies its value and the numericalize_init loop stamps it
Constant | Protected, so Attributes[Catalan] is {Constant, Protected}. Interned
name SYM_Catalan (src/sym_names.c), docstring in src/info.c. It carries no
DownValues, and D[Catalan, x] -> 0 follows from Constant.
Representation & numeric value. A bare EXPR_SYMBOL, kept exact under evaluation.
N[Catalan] returns the tabled machine double; N[Catalan, k] runs
fill_mpfr_catalan → MPFR's mpfr_const_catalan at the requested precision, returning
an EXPR_MPFR. Machine value 0.915966;
N[Catalan, 50] = 0.915965594177219015054603514932384110774149374281673.
Usage & limits. Catalan arises as the closed form of various definite integrals
and sums; NumericQ[Catalan] is True (whitelisted in is_numeric_quantity,
src/core.c). Its irrationality is open; Mathilda treats it as an exact symbol whose
digits are produced on demand by N.
- Attributes
Constant,Protected.Attributes[Catalan] = {Constant, Protected}; the symbol cannot be reassigned. - Propagated as an exact, unevaluated symbol;
NumericQ[Catalan]isTrueandD[Catalan, x] = 0. N[Catalan]gives the machine value0.915966;N[Catalan, prec]gives any precision (MPFRmpfr_const_catalan), e.g.N[Catalan, 50] = 0.915965594177219015054603514932384110774149374281673.
Attributes: Constant, Protected.
References¶
- S. R. Finch, Mathematical Constants (Cambridge Univ. Press, 2003), §1.7.
- Source:
src/numeric.c - Specification:
docs/spec/builtins/mathematical-constants.md
Notes & additional examples¶
Notes¶
Catalan is Catalan's constant G, the alternating sum over k >= 0 of
(-1)^k (2 k + 1)^-2. It is a first-class symbolic constant: it carries the
Constant attribute (so D[Catalan, x] is 0), satisfies NumericQ, and
N[Catalan, prec] evaluates it to any requested precision via an internal
fast-converging series. The 40-digit value matches the standard reference
value, and arithmetic combinations such as 8 Catalan are held symbolically
until numericalized.