cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A215577 Number of nonintersecting (or self-avoiding) rook paths joining opposite corner cells of an n X n X n grid, avoiding cells that are not on the surface.

Original entry on oeis.org

1, 18, 340812, 1553113040
Offset: 1

Views

Author

Alex Ratushnyak, Aug 16 2012

Keywords

Comments

When n<3 there are n^3 cells available, otherwise n^3 - (n-2)^3.
The length of the step is 1. The length of the path varies.

Crossrefs

Programs

  • C
    #include     // GCC -O3
    char grid[4][4][4];
    long long SIZE;
    long long calc_ways(long long x, long long y, long long z) {
        long long n;
        if (grid[x][y][z]) return 0;
        if (x+y+z==SIZE*3-3) return 1;
        grid[x][y][z]=1;
        n=0;
        if (x>0)        n =calc_ways(x-1,y,z);  // go left
        if (x0)        n+=calc_ways(x,y-1,z);  // down
        if (y0)        n+=calc_ways(x,y,z-1);  // level down
        if (z