von Neumann Neighborhood

Author

Eric W. Weisstein
May 11, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/CellularAutomata/vonNeumannNeighborhood.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/vonNeumannNeighborhood.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Definition

vonNeumannNeighborhood[r_,m_]:=Table[If[Abs[x]+Abs[y]≤r,1,0],{x,-m,m},{y,-m,m}]

Plots

GraphicsArray[Partition[Table[ArrayPlot[vonNeumannNeighborhood[n,4],Mesh->True,PlotLabel->r==n],{n,0,3}],2],ImageSize->300]

Counts of Black Cells

Table[Count[Flatten[vonNeumannNeighborhood[n,10]],1],{n,0,5}]

A001844