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.

A309236 Langton's ant on a circular grid with 4-fold rotational symmetry: number of black cells on the grid after n moves of the ant.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 5, 4, 3, 2, 3, 2, 3, 4, 3, 4, 5, 6, 5, 6, 7, 6, 7, 6, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 7, 6, 7, 6, 5, 4, 3, 4, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 7, 6, 7, 6, 7, 6, 7, 8, 7, 8, 7, 8, 9, 10, 9, 8, 7, 6, 7, 6, 5, 4
Offset: 0

Views

Author

Felix Fröhlich, Jul 17 2019

Keywords

Comments

On a white circular segment, turn right to the next edge of the segment, flip the color of that segment, then move onto the segment adjacent to that edge.
On a black circular segment, turn left to the next edge of the segment, flip the color of that segment, then move onto the segment adjacent to that edge.

Examples

			See illustrations in Fröhlich, 2019.
		

Crossrefs

Programs

  • PARI
    lista(nn) = my(c, d=1, x, y, u=1, v=List([])); print1(c); for(n=1, nn, if(x, if(x>#v, listput(v, [1, 1, 1, 1])); if(v[x][y]<0, d=d%4+1, d=(d+2)%4+1); c-=v[x][y]=-v[x][y]; if(d==3, x--; if(!x, d=(y+1)%4+1), x+=d%2; y=(y-d)%4+1), if(u<0, y=(d+2)%4+1, y=d%4+1); c-=u=-u; x=d=1); print1(", ", c)); \\ Jinyuan Wang, Jul 15 2025

Extensions

More terms from Jinyuan Wang, Jul 15 2025