# A pretty picture for Christmas ...

Rob Arthan rda at lemma-one.com
Fri Dec 24 18:03:10 CET 2004

```The following matlab code constructs the first thousand members of an
interesting sequence of complex numbers (that comes from thinking about the
diagonals of hypercubes):

m=1000;
d(1) = 1;
for n=1:m-1
d(n+1) = d(n) + i*d(n)/sqrt(n);
end

Each d(i) (i > 1) is the hypotenuse of a triangle with one leg equal to d(i-1)
and the other of unit length. The triangles fit together in a spiral in the
plane (The matlab command compass(d(1:20)) will draw a pretty plot of the
first twenty triangles).

Are there any interesting integer sequences tucked away in this construction?

It's not hard to prove that the d(i) wind around the origin arbitrarily often
(i.e.,putting a(i) = arg(d(i)/d(i-1)), the sum of the angles a(i) diverges).
So one integer sequence you get is the sequence of i-s where the d(i) cross
the positive real axis. This begins as follows:

1   17    54   110   186   281   396   532   686   861

according to the following matlab code

t = 1;
a(t) = 1;
for n=1:m-1
if (imag(d(n)) < 0) & (imag(d(n+1)) >= 0)
t = t + 1;
a(t) = n;
end
end

My calculation of the larger values of the a(i) here may be out a bit to
rounding error in the calculation of the d(i).

I was surprised I'd not seen the pretty picture formed by the sequence d(i)
before. Does it ring any bells with anyone? If nothing else, this
construction provides a challenge for your drawing skills: namely, to show
that a(2) = 18 by drawing a picture; my best effort "proved" a(2) = 17.

Seasons' greetings,

Rob.

```