Skip to content

CentralDelannoyNumbers ​

The central Delannoy numbers 1,3,13,63,321,…1, 3, 13, 63, 321, … as a lazy indexed collection.

CentralDelannoyNumbersThe count of king-move lattice paths across an n×nn \times n grid, an infinite indexed collection.

Domain: Collections

Details
  • A lazy indexed collection: Count(CentralDelannoyNumbers)=+∞Count(CentralDelannoyNumbers) = +\infty, and At(CentralDelannoyNumbers,k)At(CentralDelannoyNumbers, k) unranks term k−1k-1 via nD(n)=3(2n−1)D(n−1)−(n−1)D(n−2)n D(n) = 3(2n-1)D(n-1) - (n-1)D(n-2), D0=1D_0 = 1, D1=3D_1 = 3, bigint throughout -- At(CentralDelannoyNumbers,1)=D0=1At(CentralDelannoyNumbers, 1) = D_0 = 1.
  • OEIS A001850, starting exactly at its offset-0 term: 1,3,13,63,321,1683,…1, 3, 13, 63, 321, 1683, …; strictly increasing.
  • Membership goes through Element: Element(13,CentralDelannoyNumbers)Element(13, CentralDelannoyNumbers) is true, Element(10,CentralDelannoyNumbers)Element(10, CentralDelannoyNumbers) is false.

Definition

Epsil, as the implementation runs it.

count()

PositiveInfinity

unrank(_r)

Fold(
      Function(
                sm_a + Binomial(_r, sm_k) * Binomial(_r + sm_k, sm_k),
                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) *
                                                           Binomial(
                                                                     sq_at +
                                                                     sm_k,
                                                                     sm_k,
                                                                   ),
                                                    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) *
                                                                Binomial(
                                                                          sq_at +
                                                                          2 ^
                                                                          sq_b +
                                                                          sm_k,
                                                                          sm_k,
                                                                        ), 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 -1

valid(_x)

Apply(
       (sq_at: integer) => Fold(Function(
                                          sm_a + Binomial(sq_at, sm_k) *
                                                 Binomial(sq_at + sm_k, sm_k),
                                          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) *
                                                                Binomial(
                                                                          sq_at +
                                                                          2 ^
                                                                          sq_b +
                                                                          sm_k,
                                                                          sm_k,
                                                                        ), 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 False

Enumeration

Examples

1 more kept as data, checked against the oracles
About
Examples1
CrosswalkOEIS

See also: Count, At, Element, SchroederNumbers, PellNumbers