SchroederNumbers
The (large) Schröder numbers as a lazy indexed collection.
OEIS
A006318SchroederNumbers, for (twice the little Schröder numbers), an infinite indexed collection.Details
- A lazy indexed collection: , and unranks term by doubling LittleSchroderNumbers rather than re-deriving a recurrence -- .
- OEIS A006318, starting exactly at its offset-0 term: ; counts monotone lattice paths from to using steps , and that never rise above the diagonal.
- Membership goes through Element: is true, is false.
Definition
Epsil, as the implementation runs it.
count()
PositiveInfinityunrank(_r)
Fold(
Function(sm_a + Binomial(_r + sm_k, _r - sm_k) * (Binomial(2sm_k, sm_k) -
(0 if 2sm_k < sm_k + 1 else Binomial(2sm_k, sm_k + 1))), sm_a, sm_k),
0,
Range(0, _r, 1),
)rank(_x)
Apply(
(sq_at: integer) => sq_at if Fold(
Function(sm_a + Binomial(
sq_at + sm_k,
sq_at - sm_k,
) * (Binomial(2sm_k, sm_k) -
(0 if 2sm_k <
sm_k +
1 else Binomial(2sm_k, sm_k + 1))), sm_a, sm_k),
0,
Range(0, sq_at, 1),
) == _x else -1,
Fold(
Function(
sq_at + 2 ^ sq_b if Fold(
Function(sm_a + Binomial(sq_at +
2 ^
sq_b +
sm_k, sq_at +
2 ^
sq_b -
sm_k) *
(Binomial(
2sm_k,
sm_k,
) -
(0 if 2sm_k <
sm_k + 1 else Binomial(2sm_k, sm_k + 1))), sm_a, sm_k),
0,
Range(0, sq_at + 2 ^ sq_b, 1),
) <= _x else sq_at,
sq_at,
sq_b,
),
0,
Range(Floor(Log(Floor(Log(_x, 2)) + 2, 2)) + 1, 0, -1),
),
) if True else -1valid(_x)
Apply(
(sq_at: integer) => Fold(
Function(
sm_a + Binomial(
sq_at + sm_k,
sq_at - sm_k,
) * (Binomial(
2sm_k,
sm_k,
) -
(0 if 2sm_k < sm_k +
1 else Binomial(2sm_k, sm_k + 1))),
sm_a,
sm_k,
),
0,
Range(0, sq_at, 1),
) == _x,
Fold(
Function(
sq_at + 2 ^ sq_b if Fold(
Function(sm_a + Binomial(sq_at +
2 ^
sq_b +
sm_k, sq_at +
2 ^
sq_b -
sm_k) *
(Binomial(
2sm_k,
sm_k,
) -
(0 if 2sm_k <
sm_k + 1 else Binomial(2sm_k, sm_k + 1))), sm_a, sm_k),
0,
Range(0, sq_at + 2 ^ sq_b, 1),
) <= _x else sq_at,
sq_at,
sq_b,
),
0,
Range(Floor(Log(Floor(Log(_x, 2)) + 2, 2)) + 1, 0, -1),
),
) if True && _x >= 1 else FalseEnumeration
Examples
1 more kept as data, checked against the oraclesAbout
| Examples | 1 |
|---|---|
| Crosswalk | OEIS |
See also: Count, At, Element, LittleSchroderNumbers, CentralDelannoyNumbers