Quadratic polynomials describe the diagonal lines in the Ulam-Spiral

3.6k Views Asked by At

I'm trying to understand why is it possible to describe every diagonal line in the Ulam-Spiral with an quadratic polynomial $$2n\cdot(2n+b)+a = 4n^2 + 2nb +a$$ for $a, b \in \mathbb{N}$ and $n \in 0,1,\ldots$.

It seems to be true but why?

Wikipedia says: "The pattern also seems to appear even if the number at the center is not 1 (and can, in fact, be much larger than 1). This implies [WHY?] that there are many integer constants b and c such that the function: $4n^2+bn+c$ as $n$ counts up $\{1, 2, 3, ...\}$, a number of primes that is large by comparison with the proportion of primes among numbers of similar magnitude."

I can't find a source with a detailed explanation.

ulam spiral

I found these equations:

diagonal lines

So here is the solution:

\begin{align*} y_t - y_{t+1} - (y_{t+1} - y_{t+2}) &= 8\\ y_t - 2y_{t+1} + y_{t+2} &= 8\\ y_{t+2} - 2y_{t+1} + y_t &= 8 \end{align*}

1) We solve $y_{t+2} - 2y_{t+1} + y_t = 0.$

Let $y_t = A\beta^t$ \begin{align*} A\beta^{t+2} - 2A\beta^{t+1} + A\beta^t &= 0\\ A\beta^{t}\cdot (\beta^2 - 2\beta + 1) &= 0 \end{align*} $\beta^2 - 2\beta + 1 = 0$ has two identical solutions $\beta_{1,2} = 1$. So with $A_1$ and $A_2t$ we get $$y_t = A_1 + A_2t.$$

2) $1 + a_1 + a_2 = 0$ and $a_1 = -2$ so let $y_t = ct^2$ \begin{align*} c\cdot(t+2)^2 - 2c\cdot(t+1)^2 + ct^2 &= 8\\ c\cdot\big(t^2+4t+4 - 2\cdot(t^2+2t+1) + t^2\big) &= 8\\ c\cdot(t^2+4t+4 - 2t^2-4t-2 + t^2) &= 8\\ 2c &= 8\\ c &= 4 \end{align*} So $y_t = 4t^2$

3) The complete solution is $$y_t = 4t^2 + A_2t + A_1.$$

The "exclusion lines" seem to be interesting too: $$4n^2+n$$ $$4n^2+3n$$ $$4n^2+3n-1$$ $$4n^2-n$$ seem not to have any primes at all.

Useful website I found a bit late: http://ulamspiral.com

2

There are 2 best solutions below

6
On BEST ANSWER

Note that the first "ring" of numbers has just 1 number in it, the next ring has $9-1=8$ numbers, then $25-9=16$, $49-25=24$, $81-49=32$, and so on. These numbers (aside from the first) are increasing by 8. When you start somewhere and go out along a diagonal, with each step you increase by 8 more than you did with the previous step. That is, the second difference of the sequence as you go out along a diagonal is a constant 8; $a_{n+2}-2a_{n+1}+a_n=8$. And the general solution of that difference equation ("recurrence relation") is $a_n=4n^2+bn+c$.

0
On

Reading georgmierau comment, I've been trying to reach this "arbitrary" 8, so here what I've done:

Let $A(n)$ be the cardinal number of the $n^{th}$ ring in Ulam's spiral. $$A(1)=1\\A(2)=8=(2\cdot2-1)^2-1^2\\A(3)=16=(2\cdot3-1)^2-3^2\\ \vdots \\ A(n)=(2n-1)^2-(2n-3)^2\Rightarrow A(n)=8n-8, n\neq1$$

So, $A(n+1)-A(n)=8$

That means that each time we pass to the next ring, its cardinal number will be the same of the last one added by 8.