TOPICS
Search

N-Curve


An N-curve, in the construction of Whale (2026), is a plane curve obtained from an integer sequence by joining circular arcs of equal arc length tangentially. Each term determines the signed change in tangential angle along the corresponding circular arc. The construction gives a geometric representation of the sequence and its residues. It is related to turtle geometry, in which successive instructions specify line segment lengths and turns (Abelson and diSessa 1981, Colestock 2017).

For a sequence a_0, a_1, ..., a positive integer modulus b, and an integer offset c, define

 theta_n=pi/(180)((a_n (mod b))+c),
(1)

where a_n (mod b) is the least nonnegative residue and theta_n is measured in radians. Thus (a_n (mod b))+c is the turn in degrees. The choice b=360, c=-180 gives signed turns from -180 through 179 degrees.

Identify the plane with the complex plane, set z_0=0 and phi_0=0, and normalize the arc length of each piece to 1. The displacement of a piece whose initial tangential angle is zero is

 H(theta)={(e^(itheta)-1)/(itheta)   if theta!=0; 1   if theta=0,
(2)

with H(0) given by the continuous limit. The sequence of endpoints and directions satisfies

z_(n+1)=z_n+e^(iphi_n)H(theta_n)
(3)
phi_(n+1)=phi_n+theta_n.
(4)

For 0<=u<=1, the corresponding piece is

 z(n+u)=z_n+e^(iphi_n)int_0^ue^(itheta_nv)dv.
(5)

Its unit tangent vector is e^(i(phi_n+theta_nu)), so the join has a continuous tangent vector. A zero turn gives a line segment.

N-CurveExamples

The examples show N-curves for the triangular numbers, square numbers, Fibonacci numbers, and prime gaps (OEIS A000217, OEIS A000290, OEIS A000045, and OEIS A001223). The first three sequences begin at index 0. The prime gaps begin with p_2-p_1=1, where p_j is the jth prime number. The orange dots mark the initial points. The modulus, offset, and number N of pieces are shown for each example. The prime gaps panel shows a finite initial segment without asserting closure.

N-CurveClosure

The closure question for a periodic sequence of turns reduces to a rigid motion. Suppose theta_(n+p)=theta_n and write d=z_p. Then

 z(t+p)=d+qz(t),
(6)

where q=exp(isum_(j=0)^(p-1)theta_j). When q!=1, this rigid motion is a rotation about d/(1-q). If q is a root of unity of order r>1, then 1+q+...+q^(r-1)=0. Consequently, after r blocks both the point and its tangent vector return to their initial values. The completed trace has rotational symmetry of order at least r. Additional symmetries of the trace can make the full order larger. A return of the point alone can also occur before the tangent vector returns.

For integer turns in degrees, let S be their sum over a block. If q!=1, then

 r=(360)/(gcd(360,S)),
(7)

where gcd denotes the greatest common divisor. In the illustrated examples, the triangular numbers have a residue period of 720 and S=240  (mod360), the square numbers have a residue period of 180 and S=30  (mod360), and the Fibonacci numbers modulo 36 have a residue period of 24 and S=324  (mod360). Their traces therefore close after 2160, 2160, and 240 pieces, respectively.

When q=1, the block gives a translation. The curve closes with matching tangent vector after a block iff d=0, and otherwise repeats along an unbounded chain. For example, the two signed turns pi, -pi give

 q=1, d=(4i)/pi!=0,
(8)

so returning to the initial direction does not imply closure. The three panels illustrate a block with turns 120 and 0 degrees, a block with turns 180 and -180 degrees, and a block with two turns of 180 degrees. These produce a rotation of order 3, a nonzero translation, and the identity transformation, respectively.


See also

Arc Length, Curvature, Integer Sequence, Periodic Sequence, Plane Curve, Rotational Symmetry, Turtle Geometry

Explore with Wolfram|Alpha

References

Abelson, H. and diSessa, A. A. Turtle Geometry: The Computer as a Medium for Exploring Mathematics. Cambridge, MA: MIT Press, 1981.Colestock, A. "Let the Numbers Do the Walking: Generating Turtle Dances on the Plane from Integer Sequences." In Proc. Bridges 2017: Mathematics, Art, Music, Architecture, Education, Culture (Ed. D. Swart, C. Séquin, and K. Fenyvesi). Phoenix, AZ: Tessellations Publishing, pp. 139-146, 2017. https://archive.bridgesmathart.org/2017/bridges2017-139.pdf.Whale, G. "A New Visualization Tool for OEIS Sequences." SeqFan. Aug. 1, 2026. https://groups.google.com/g/seqfan/c/vGfMma6DkDk.Sloane, N. J. A. Sequences A000045 A000217 A000290 A001223 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "N-Curve." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/N-Curve.html

Subject classifications