12

1

First we craft a function to return the quadrant boundary based on Oppermann's Conjecture

```
a[n_] := (Mod[n, 2] + n^2 + 2 n)/4
```

Then we create a few lists

```
r = 10;
q = 1;
q1 = Table[a[q + 4 (n - 1)] <-> a[q + 4 (n)], {n, 1, r}];
q = 2;
q2 = Table[a[q + 4 (n - 1)] <-> a[q + 4 (n)], {n, 1, r}];
q = 3;
q3 = Table[a[q + 4 (n - 1)] <-> a[q + 4 (n)], {n, 1, r}];
q = 4;
q4 = Table[a[q + 4 (n - 1)] <-> a[q + 4 (n)], {n, 1, r}];
u = Flatten[Table[{(n - 1) <-> n}, {n, 2, a[4 + 4 r] + 1}]];
```

We produce the normal Ulam's Spiral

```
Graph[u]
```

We don't get the spiral when we attempt to combine the diagonal lists by using this

```
Graph[Union[u, q1, q2, q3, q4]]
```

How can we overlay the diagonals onto the spiral?

2Honestly, I'm quite surprised that

`Graph[u]`

produces a spiral! None of the built-in layout methods give this specific layout. It must be treating this graph as a special case. – Szabolcs – 2012-05-30T10:57:39.033I have linked from here http://math.stackexchange.com/questions/151902/ulams-spiral-oppermanns-diagonals-and-the-golden-ratio

– Fred Kline – 2012-05-31T06:42:23.217