Function Repository Resource:

LatticePointsArrangement (1.1.0)current version: 1.1.1 »

Get lattice points in a variety of arrangements

Contributed by: Sander Huisman
 ResourceFunction["LatticePointsArrangement"][arrangement,n] generates the first n lattice points based on arrangement. ResourceFunction["LatticePointsArrangement"][] returns all the possible arrangements.

Details

The following arrangements can be chosen as arrangement:

Examples

Basic Examples (1)

Create 20 points in a counterclockwise spiral starting in the eastern direction:

 In[1]:=
 Out[1]=

Scope (2)

Create some points based on zigzagging diagonally in the first two quadrants:

 In[2]:=

Visualize the points:

 In[3]:=
 Out[3]=

LatticePointsArrangement without any arguments returns all the possible arrangements:

 In[4]:=
 Out[4]=

Currently 160 arrangements are known:

 In[5]:=
 Out[5]=

Applications (1)

Create the Ulam prime spiral:

 In[6]:=
 Out[7]=

Neat Examples (1)

Recreate the OEIS A316667 sequence of a horse moving on a spirally numbered board and moving to the lowest available unvisited square at each step:

 In[8]:=
 In[9]:=
 In[10]:=
 In[11]:=
 In[12]:=
 Out[13]=

SHuisman

Version History

• 1.1.1 – 21 August 2023
• 1.1.0 – 04 May 2022
• 1.0.1 – 09 August 2021
• 1.0.0 – 02 October 2019