Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A129700
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A129700 Number of n-step self-avoiding paths on octant grid starting at octant origin. +0
1
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; listen)
OFFSET

1,3

COMMENT

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.

PROGRAM

// 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: A077055 A022951 A128305 this_sequence A049344 A080877 A007165

Adjacent sequences: A129697 A129698 A129699 this_sequence A129701 A129702 A129703

KEYWORD

nonn

AUTHOR

Bill Blewett (BillBle(AT)microsoft.com), Jun 01 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified August 29 17:54 EDT 2008. Contains 143238 sequences.


AT&T Labs Research