Nonplanar equilateral lattice "pentagons" It is well-known that no two-dimensional point lattice contains a regular pentagon. (See for example http://mathworld.wolfram.com/LatticePolygon.html.) The same is true for lattices in $\mathbb{R}^n$, simply because any such polygon would lie in a two-dimensional sublattice. If we relax the requirement that the pentagon lie in a plane, we can easily find a closed path of 5 equal length sides: for example, in $\mathbb{R}^5$ with the integer lattice, we can use the path $$(1,0,0,0,0)\to(0,1,0,0,0)\to(0,0,1,0,0)\to(0,0,0,1,0)\to(0,0,0,0,1).$$ (These are the vertices of the standard 4-simplex.) The same construction, of course, works to find a nonplanar equilateral lattice "$n$-gon" for any $n$, as the vertices of the standard $n+1$-simplex in the integer lattice. We can improve this to a lattice in $\mathbb{R}^{n-1}$ by restricting to the plane $x_1+\cdots+x_n=1$. My question is if this is the best we can do, dimension-wise. So is it possible, for example, to find a nonplanar equilateral lattice pentagon in some lattice in $\mathbb{R}^3$? What can be said about the minimal dimension of lattice containing a nonplanar equilateral lattice $n$-gon?
(Note: This was originally posted on math stackexchange here, but nobody answered it.)
 A: By using integer programming (with the help of Gurobi solver), I found an equilateral pentagon of side $\sqrt{2}$ in $\mathbb{Z}^3$. Its vertices are:
$$(0, 0, 0); (1, 1, 0); (1, 0, 1); (0, 0, 2); (0, 1, 1)$$
For those interested in the IP model, below is the code
import gurobipy as gp
from gurobipy import GRB


nSides = 5
model = gp.Model('Equilateral polygon')
model.params.Nonconvex = 2

vars = model.addMVar((nSides, 3), vtype = GRB.INTEGER)
distanceSquared = model.addVar(vtype = GRB.INTEGER, lb = 0, ub = GRB.INFINITY)

# fix a vertex at the origin
model.addConstr(vars[0, 0] == 0)
model.addConstr(vars[0, 1] == 0)
model.addConstr(vars[0, 2] == 0)

# equilateral polygon constraints
model.addConstr(distanceSquared >= 1)
for i in range(nSides):
    xA, yA, zA = vars[i]
    xB, yB, zB = vars[(i+1) % nSides]
    dAB = (xA - xB)**2 + (yA - yB)**2 + (zA - zB)**2
    model.addConstr(dAB == distanceSquared)

# distinct vertices constraints
for i in range(nSides):
    for j in range(i+1, nSides):
        xA, yA, zA = vars[i]
        xB, yB, zB = vars[j]
        dAB = (xA - xB)**2 + (yA - yB)**2 + (zA - zB)**2
        model.addConstr(dAB >= 1)

model.setObjective(distanceSquared, sense = GRB.MINIMIZE)
model.optimize()
print(vars.x)

Picture:

A: Here are the vertices of an equilateral pentagon of side $\sqrt{2}$ in $\mathbb{Q}^3$ in order: 
$(0,0,0), (1,1,0), (1,2,1), (0,1,1), (-\frac{1}{3}, -\frac{1}{3}, \frac{4}{3}).$
The first $4$ points form a rhombus. The last point satisfies $z=1-y, x^2+y^2+(1-y)^2=2.$ This has the rational solution $(1,1,0)$ and lines of any rational slope through $(1,1)$ in the $xy$-plane intersect $x^2+y^2+(1-y)^2=2$ in another rational point. I chose $x=y$. Expanding this by a factor of $3$ gives a nonplanar equilateral pentagon in $\mathbb{Z}^3.$
A: Here is Douglas Zare's pentagon, after scaling by $3$:
$$(0, 0, 0),\; (3, 3, 0),\; (3, 6, 3),\; (0, 3, 3),\; (-1, -1, 4)$$
     
A: In order to construct a lattice containing a "regular non-planar $n$-gone" take a lattice $\Lambda$ with an isometry of order exactly $n$. Any orbit with $n$ elements (i.e. with trivial stabilizer for the cyclic subgroup of $n$ elements generated by the above element) defines a non-planar regular $n$-gone. The smallest dimension where this is possible is the smallest dimension $d$ such that the cyclic group $\mathbb Z/n\mathbb Z$ has a faithful linear representation in
$\mathrm{GL}_d(\mathbb Q)$ (which is $4$ for the cyclic
group of order $5$). There might however exist "non-planar regular $n$-gones" in lattices of smaller dimension. Their vertices do however never form an orbit for an isometry group acting on the lattice (this is of course the case for the $3$-dimensional example given in previous answers). There are therefore three notions of "non-planar regularity": a weak one (just isometric edges) and a stronger one (an isometry subgroup of the lattices acts transitively on vertices)
and the strongest one: an isometry subgroup of the containing lattice acts transitively on flags (corresponding to a dihedral group with $2n$ elements). The last one is probably best from a geometric perspective. Minimal possible dimensions for the last two questions are given by minimal dimensions containing rational representations of the underlying groups.
Added: I am not completely sure in the case of dihedral groups, my limited two dimensional intuition might be wrong!
