Sylvester's sequence #
This file introduces the Sylvester's sequence
Implementation notes #
We follow the presentantion from Wikipedia.
Main results #
- Basic facts: the first terms of the sequence are 2, 3, 7, 43.
sylvester_prod_finset_add_one: each term of the sequence is one plus the product of its predecessors.sylvester_strictMono: the sequence is strictly monotonic.sylvester_coprime: Pairwise co-primality.sylvester_eq_floor_constant_pow: explicit non-recursive formula.partialSums_sylvester_eq_one_minus_one_div_pred: compute sums of reciprocals of the sequence.
References #
Sylvester's sequence.
Equations
- Sequence.Sylvester 0 = 2
- Sequence.Sylvester n.succ = Sequence.Sylvester n * (Sequence.Sylvester n - 1) + 1
Instances For
OEIS sequence offset
Equations
Instances For
This recurrence motivates the alternative name of Euclid numbers: $$ \mathrm{sylvester}~n = 1 + \prod_{i=0}^{n-1} \mathrm{sylvester}~i, $$ assuming the product over the empty set to be 1.
Coprimality #
Explicit formula #
The constant that gives an explicit formula for the Sylvester's sequence: $$ \mathrm{sylvester}~n = \left\lfloor\mathrm{sylvesterConstant}^{2^{n+1}} + \frac{1}{2}\right\rfloor, $$ for all natural $n$. The constant is approximately $1.2640847\ldots$.
Equations
- Sequence.sylvesterConstant = ⨆ (i : ℕ), Sequence.sylvesterBelow✝ i
Instances For
Sum of reciprocals #
Partial sums of the series ∑ 1/(sylvester i).
Equations
- Sequence.PartialSumsSylvester n = ∑ i ∈ Finset.range n, 1 / ↑(Sequence.Sylvester i)
Instances For
Formula for the partial sums: $$ \sum_{i=0}^{n-1} \frac{1}{\mathrm{sylvester}~i} = 1 - \frac{1}{\mathrm{sylvester}~n - 1}. $$