|
| |
|
|
A129700
|
|
Number of n-step self-avoiding paths on octant grid starting at octant origin.
|
|
0
|
|
|
|
1, 1, 2, 3, 8, 14, 36, 70, 177, 372, 942, 2056, 5222, 11736, 29878, 68576, 175038, 408328, 1044533, 2468261, 6326688, 15107015, 38791865, 93432564, 240296399, 583001850, 1501520574
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
1,3
|
|
|
COMMENTS
|
Similar to A038373 but with octant grid instead of quadrant. An octant grid is either half of a quadrant grid when divided on the diagonal and including the diagonal grid squares. It's shape is that of a right triangle with a stair step edge on the hypotenuse. Coordinates of squares satisfy x>=0 and y>=0 and x>=y.
|
|
|
LINKS
|
Table of n, a(n) for n=1..27.
|
|
|
PROG
|
// C++ code #define GRIDSIZE 20 void Recur(int level, int maxlevel, int rgBd[][GRIDSIZE], int i, int j, int rgCt[]) { if (i < 0 || j < 0 || i >= GRIDSIZE || j >= GRIDSIZE || level >= maxlevel || j > i || rgBd[i][j] != 0) return; rgCt[level] += 1; rgBd[i][j] = 1; Recur(level + 1, maxlevel, rgBd, i + 1, j, rgCt); Recur(level + 1, maxlevel, rgBd, i - 1, j, rgCt); Recur(level + 1, maxlevel, rgBd, i, j + 1, rgCt); Recur(level + 1, maxlevel, rgBd, i, j - 1, rgCt); rgBd[i][j] = 0; } int main(int argc, char **argv) { int rgBd[GRIDSIZE][GRIDSIZE] = {0}; int rgCt[GRIDSIZE] = {0}; int maxlevel = GRIDSIZE; if (argc > 1) { maxlevel = atoi(argv[1]); if (maxlevel < 0 || maxlevel > GRIDSIZE) { printf("Bad argument"); return 0; } } Recur(0, maxlevel, rgBd, 0, 0, rgCt); for (int i = 0; i < maxlevel; i++) printf("%2d ", rgCt[i]); return 0; }
|
|
|
CROSSREFS
|
Cf. A038373.
Sequence in context: A173149 A128305 A201361 * A197466 A049344 A080877
Adjacent sequences: A129697 A129698 A129699 * A129701 A129702 A129703
|
|
|
KEYWORD
|
nonn
|
|
|
AUTHOR
|
Bill Blewett, Jun 01 2007
|
|
|
STATUS
|
approved
|
| |
|
|