<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>antony-mathematics</title>
<link>https://antonyp.com/archive</link>
<atom:link href="https://antonyp.com/archive.xml" rel="self" type="application/rss+xml"/>
<description>Notes and essays on mathematics</description>
<image>
<url>https://antonyp.com/assets/card.png</url>
<title>antony-mathematics</title>
<link>https://antonyp.com/archive</link>
<height>76</height>
<width>144</width>
</image>
<generator>quarto-1.11.9</generator>
<lastBuildDate>Sun, 01 Nov 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Why the Ulam spiral has diagonals</title>
  <dc:creator>Antony </dc:creator>
  <link>https://antonyp.com/posts/ulam-diagonals/</link>
  <description><![CDATA[ 





<div id="am-page" hidden="" data-kind="post" data-src="posts/ulam-diagonals/index.qmd" data-series="Looking at primes"></div>
<p>The legend is that in 1963, sitting through a dull talk, Stanisław Ulam wrote the integers in a square spiral and circled the primes. They weren’t randomly scattered. They lined up along diagonals.</p>
<p>You can see the same spiral on <a href="../../index.html">the home page</a>: <img src="https://latex.codecogs.com/png.latex?1"> is in the centre, the numbers wind outward anticlockwise, and every prime is a filled square. Hover over it and the diagonals stand out. The pattern has two causes, one easy and one deep.</p>
<section id="reason-1-each-diagonal-has-a-fixed-parity" class="level2">
<h2 class="anchored" data-anchor-id="reason-1-each-diagonal-has-a-fixed-parity">Reason 1: each diagonal has a fixed parity</h2>
<p>The spiral visits cells one step at a time, so consecutive integers are always in adjacent cells. That means parity alternates like a chessboard: if a cell at position <img src="https://latex.codecogs.com/png.latex?(x,%20y)"> holds <img src="https://latex.codecogs.com/png.latex?n">, then <img src="https://latex.codecogs.com/png.latex?n%20%5Cequiv%20x%20+%20y%20+%201%20%5Cpmod%202">.</p>
<p>Moving along a diagonal changes <img src="https://latex.codecogs.com/png.latex?x"> and <img src="https://latex.codecogs.com/png.latex?y"> by <img src="https://latex.codecogs.com/png.latex?%5Cpm%201"> each, so <img src="https://latex.codecogs.com/png.latex?x%20+%20y"> keeps its parity, and <strong>every number on a given diagonal has the same parity</strong>. Every prime except <img src="https://latex.codecogs.com/png.latex?2"> is odd, so half of all diagonals contain no primes beyond possibly <img src="https://latex.codecogs.com/png.latex?2">. Even before looking at primes, the spiral is split into alternating diagonal stripes.</p>
</section>
<section id="reason-2-diagonals-are-quadratic-polynomials" class="level2">
<h2 class="anchored" data-anchor-id="reason-2-diagonals-are-quadratic-polynomials">Reason 2: diagonals are quadratic polynomials</h2>
<p>Follow a diagonal outward from the centre. The four rays starting at <img src="https://latex.codecogs.com/png.latex?1"> are</p>
<table class="caption-top table">
<caption>The diagonal rays through <img src="https://latex.codecogs.com/png.latex?1">, for <img src="https://latex.codecogs.com/png.latex?k%20=%200,%201,%202,%20%5Cdots"></caption>
<thead>
<tr class="header">
<th style="text-align: left;">Direction</th>
<th style="text-align: left;">Values</th>
<th style="text-align: left;">Formula</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">up-right</td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?1,%203,%2013,%2031,%2057,%20%5Cdots"></td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?4k%5E2%20-%202k%20+%201"></td>
</tr>
<tr class="even">
<td style="text-align: left;">up-left</td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?1,%205,%2017,%2037,%2065,%20%5Cdots"></td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?4k%5E2%20+%201"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">down-left</td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?1,%207,%2021,%2043,%2073,%20%5Cdots"></td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?4k%5E2%20+%202k%20+%201"></td>
</tr>
<tr class="even">
<td style="text-align: left;">down-right</td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?1,%209,%2025,%2049,%2081,%20%5Cdots"></td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?(2k+1)%5E2"></td>
</tr>
</tbody>
</table>
<div id="prp-quadratic" class="theorem proposition">
<p><span class="theorem-title"><strong>Proposition 1</strong></span> Along any diagonal ray of the spiral, the entries are the values of a quadratic <img src="https://latex.codecogs.com/png.latex?4k%5E2%20+%20bk%20+%20c"> at <img src="https://latex.codecogs.com/png.latex?k%20=%200,%201,%202,%20%5Cdots"></p>
</div>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span>The <img src="https://latex.codecogs.com/png.latex?m">-th ring around the centre has <img src="https://latex.codecogs.com/png.latex?8m"> cells. Each step outward along a diagonal moves into the next ring, which has <img src="https://latex.codecogs.com/png.latex?8"> more cells than the previous one, so the gap between consecutive entries grows by exactly <img src="https://latex.codecogs.com/png.latex?8"> each step. A sequence with constant second difference <img src="https://latex.codecogs.com/png.latex?8"> is a quadratic with leading coefficient <img src="https://latex.codecogs.com/png.latex?8/2%20=%204">.</p>
</div>
<p>So the question “why are some diagonals full of primes?” becomes “why do some quadratic polynomials produce more primes than others?” The down-right ray has no primes at all, since its values are perfect squares. The up-left ray <img src="https://latex.codecogs.com/png.latex?4k%5E2%20+%201%20=%20(2k)%5E2%20+%201"> is especially rich in primes, and there is a reason for that:</p>
<div id="lem-sum-of-squares" class="theorem lemma">
<p><span class="theorem-title"><strong>Lemma 1</strong></span> If an odd prime <img src="https://latex.codecogs.com/png.latex?p"> divides <img src="https://latex.codecogs.com/png.latex?m%5E2%20+%201">, then <img src="https://latex.codecogs.com/png.latex?p%20%5Cequiv%201%20%5Cpmod%204">.</p>
</div>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span>If <img src="https://latex.codecogs.com/png.latex?p%20%5Cmid%20m%5E2%20+%201"> then <img src="https://latex.codecogs.com/png.latex?m%5E2%20%5Cequiv%20-1%20%5Cpmod%20p">, so <img src="https://latex.codecogs.com/png.latex?m"> has order exactly <img src="https://latex.codecogs.com/png.latex?4"> in <img src="https://latex.codecogs.com/png.latex?(%5CZ/p%5CZ)%5E%5Ctimes">. By Lagrange’s theorem <img src="https://latex.codecogs.com/png.latex?4%20%5Cmid%20p%20-%201">.</p>
</div>
<p>So <img src="https://latex.codecogs.com/png.latex?4k%5E2%20+%201"> is never divisible by <img src="https://latex.codecogs.com/png.latex?3,%207,%2011,%2019,%20%5Cdots">, which is half of all odd primes. It avoids the most common small factors, so its values are more likely to be prime. Other diagonals have the opposite problem: <img src="https://latex.codecogs.com/png.latex?4k%5E2%20+%202k%20+%201%20%5Cequiv%20(k+1)%5E2%20%5Cpmod%203">, for example, so it is divisible by <img src="https://latex.codecogs.com/png.latex?3"> whenever <img src="https://latex.codecogs.com/png.latex?k%20%5Cequiv%202%20%5Cpmod%203">.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>What’s still open
</div>
</div>
<div class="callout-body-container callout-body">
<p>There are infinitely many primes (<a href="../infinitely-many-primes/#thm-euclid"></a>), but nobody has proved that <img src="https://latex.codecogs.com/png.latex?n%5E2%20+%201"> is prime for infinitely many <img src="https://latex.codecogs.com/png.latex?n">. This is Landau’s fourth problem from 1912 and it is still unsolved. The Hardy–Littlewood <em>Conjecture F</em> goes further and predicts how many primes each quadratic should produce, based on exactly the kind of small-prime bookkeeping in Lemma&nbsp;1. The spiral agrees with it very well, but the conjecture is unproven.</p>
</div>
</div>
</section>
<section id="eulers-lucky-polynomial" class="level2">
<h2 class="anchored" data-anchor-id="eulers-lucky-polynomial">Euler’s lucky polynomial</h2>
<p>The most famous diagonal belongs to Euler’s polynomial <img src="https://latex.codecogs.com/png.latex?n%5E2%20+%20n%20+%2041">, which is prime for every <img src="https://latex.codecogs.com/png.latex?n"> from <img src="https://latex.codecogs.com/png.latex?0"> to <img src="https://latex.codecogs.com/png.latex?39">. Start the spiral at <img src="https://latex.codecogs.com/png.latex?41"> instead of <img src="https://latex.codecogs.com/png.latex?1"> and those forty primes lie on a single unbroken diagonal. At <img src="https://latex.codecogs.com/png.latex?n%20=%2040"> it fails, since <img src="https://latex.codecogs.com/png.latex?40%5E2%20+%2040%20+%2041%20=%2041%5E2">.</p>
<p>Try other constants <img src="https://latex.codecogs.com/png.latex?A"> in <img src="https://latex.codecogs.com/png.latex?n%5E2%20+%20n%20+%20A">. The run of primes is long only for a few special values:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="65" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 64;"><span id="cb1-65">viewof A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">range</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">101</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">value</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">step</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constant A"</span>})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="71" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 70;"><span id="cb2-71">isPrime <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> { <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">===</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> }</span>
<span id="cb2-72">values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> ({n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">v</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">prime</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">isPrime</span>(n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A)}))</span>
<span id="cb2-73">run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> { <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">isPrime</span>(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A)) r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> }</span>
<span id="cb2-74"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;p class="am-ojs-caption"&gt;n² + n + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is prime for n = 0, …, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> — a run of &lt;strong&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>run<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/strong&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">===</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (as long as possible!)"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">.&lt;/p&gt;</span></span>
<span id="cb2-75"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;div class="am-prime-grid"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;span class=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prime</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is-prime"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> title=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">v</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt;`</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-3" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-4" data-nodetype="expression">

</div>
</div>
</div>
</div>
<p>Only <img src="https://latex.codecogs.com/png.latex?A%20=%202,%203,%205,%2011,%2017,%2041"> give the longest possible run, primes for all <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20n%20%5Cle%20A%20-%202">. These are Euler’s <em>lucky numbers</em>, and there are exactly six of them. The reason is deep: a theorem of Rabinowitsch says the run is as long as possible exactly when the number field <img src="https://latex.codecogs.com/png.latex?%5CQ(%5Csqrt%7B1%20-%204A%7D)"> has unique factorisation, and the Baker–Heegner–Stark theorem shows there are only finitely many such fields.</p>
<p>So the same spiral goes from a parity argument, to quadratic residues, to an open conjecture, to class numbers.</p>



</section>

<div class="quarto-listing quarto-listing-container-custom" id="listing-am-post-index">
<div id="am-post-index" hidden="" data-posts="JTVCJTdCJTIydGl0bGUlMjIlM0ElMjJUaGUlMjBCYXNlbCUyMHByb2JsZW0lMkMlMjBhbmQlMjB3aGVyZSUyMHRoZSUyMCVDRiU4MCUyMGNvbWVzJTIwZnJvbSUyMiUyQyUyMnBhdGglMjIlM0ElMjJwb3N0cyUyRmJhc2VsLXByb2JsZW0lMkZpbmRleC5odG1sJTIyJTJDJTIyZGF0ZSUyMiUzQSUyMjIwMjYtMTAtMjYlMjIlMkMlMjJjYXRlZ29yaWVzJTIyJTNBJTVCJTIyQW5hbHlzaXMlMjIlMkMlMjJJbmZpbml0ZSUyMFNlcmllcyUyMiU1RCUyQyUyMnNlcmllcyUyMiUzQW51bGwlMkMlMjJjb3Vyc2UlMjIlM0FudWxsJTJDJTIybGVjdHVyZSUyMiUzQW51bGwlN0QlMkMlN0IlMjJ0aXRsZSUyMiUzQSUyMlRocmVlJTIwcHJvb2ZzJTIwdGhhdCUyMHRoZXJlJTIwYXJlJTIwaW5maW5pdGVseSUyMG1hbnklMjBwcmltZXMlMjIlMkMlMjJwYXRoJTIyJTNBJTIycG9zdHMlMkZpbmZpbml0ZWx5LW1hbnktcHJpbWVzJTJGaW5kZXguaHRtbCUyMiUyQyUyMmRhdGUlMjIlM0ElMjIyMDI2LTEwLTEyJTIyJTJDJTIyY2F0ZWdvcmllcyUyMiUzQSU1QiUyMk51bWJlciUyMFRoZW9yeSUyMiUyQyUyMlByb29mcyUyMiU1RCUyQyUyMnNlcmllcyUyMiUzQSUyMkxvb2tpbmclMjBhdCUyMHByaW1lcyUyMiUyQyUyMmNvdXJzZSUyMiUzQW51bGwlMkMlMjJsZWN0dXJlJTIyJTNBbnVsbCU3RCU1RA=="></div>

<div class="listing-no-matching d-none">No matching items</div>
</div><a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><div class="code-copy-outer-scaffold"><pre class="sourceCode quarto-appendix-bibtex code-with-copy"><code class="sourceCode bibtex">@online{2026,
  author = {, Antony},
  title = {Why the {Ulam} Spiral Has Diagonals},
  date = {2026-11-01},
  url = {https://antonyp.com/posts/ulam-diagonals/},
  langid = {en}
}
</code></pre></div><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-2026" class="csl-entry quarto-appendix-citeas">
Antony. 2026. <span>“Why the Ulam Spiral Has Diagonals.”</span> November
1. <a href="https://antonyp.com/posts/ulam-diagonals/">https://antonyp.com/posts/ulam-diagonals/</a>.
</div></div></section></div> ]]></description>
  <category>Number Theory</category>
  <category>Visual</category>
  <guid>https://antonyp.com/posts/ulam-diagonals/</guid>
  <pubDate>Sun, 01 Nov 2026 00:00:00 GMT</pubDate>
  <media:content url="https://antonyp.com/posts/ulam-diagonals/card.png" medium="image" type="image/png"/>
</item>
<item>
  <title>The Basel problem, and where the π comes from</title>
  <dc:creator>Antony </dc:creator>
  <link>https://antonyp.com/posts/basel-problem/</link>
  <description><![CDATA[ 





<div id="am-page" hidden="" data-kind="post" data-src="posts/basel-problem/index.qmd"></div>
<p>In 1734 Euler announced that <span id="eq-basel"><img src="https://latex.codecogs.com/png.latex?%0A%5Csum_%7Bn=1%7D%5E%7B%5Cinfty%7D%20%5Cfrac%7B1%7D%7Bn%5E2%7D%20%5C;=%5C;%201%20+%20%5Cfrac14%20+%20%5Cfrac19%20+%20%5Cfrac1%7B16%7D%20+%20%5Ccdots%20%5C;=%5C;%20%5Cfrac%7B%5Cpi%5E2%7D%7B6%7D.%0A%5Ctag%7B1%7D"></span></p>
<p>The problem had been open since 1650 and had beaten the Bernoullis. The surprise is the <img src="https://latex.codecogs.com/png.latex?%5Cpi">: nothing on the left side mentions circles. Below is a proof that makes it clear where the circle comes from.</p>
<section id="convergence-is-the-easy-part" class="level2">
<h2 class="anchored" data-anchor-id="convergence-is-the-easy-part">Convergence is the easy part</h2>
<p>Comparing with a telescoping sum shows that Equation&nbsp;1 converges, and to something less than <img src="https://latex.codecogs.com/png.latex?2">: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0A%5Csum_%7Bn=1%7D%5E%7BN%7D%20%5Cfrac%7B1%7D%7Bn%5E2%7D%20&amp;%5C;%3C%5C;%201%20+%20%5Csum_%7Bn=2%7D%5E%7BN%7D%20%5Cfrac%7B1%7D%7Bn(n-1)%7D%20%5C%5C%0A&amp;%5C;=%5C;%201%20+%20%5Csum_%7Bn=2%7D%5E%7BN%7D%5Cleft(%5Cfrac%7B1%7D%7Bn-1%7D%20-%20%5Cfrac1n%5Cright)%20%5C;=%5C;%202%20-%20%5Cfrac1N.%0A%5Cend%7Baligned%7D%0A"></p>
<p>Finding the exact value is much harder. Convergence is also slow: the tail after <img src="https://latex.codecogs.com/png.latex?N"> terms is about <img src="https://latex.codecogs.com/png.latex?1/N">, so after a hundred terms you are still off by about 0.01. Try it:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="29" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 28;"><span id="cb1-29">viewof N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">range</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">value</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">step</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Terms N"</span>})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="35" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 34;"><span id="cb2-35">partial <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> { <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> }</span>
<span id="cb2-36">target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Math</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">PI</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span>
<span id="cb2-37"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div class="am-stat-row"&gt;</span></span>
<span id="cb2-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;div&gt;&lt;span&gt;Partial sum&lt;/span&gt;&lt;strong&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>partial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">toFixed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/strong&gt;&lt;/div&gt;</span></span>
<span id="cb2-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;div&gt;&lt;span&gt;π²/6&lt;/span&gt;&lt;strong&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">toFixed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/strong&gt;&lt;/div&gt;</span></span>
<span id="cb2-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;div&gt;&lt;span&gt;Error × N&lt;/span&gt;&lt;strong&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>((target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> partial) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">toFixed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/strong&gt;&lt;/div&gt;</span></span>
<span id="cb2-41"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-2-3" data-nodetype="expression">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="45" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 44;"><span id="cb3-45">Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="cb3-46">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">height</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">260</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-47">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marginLeft</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-48">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">style</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">background</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"transparent"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fontFamily</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Familjen Grotesk, sans-serif"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fontSize</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13px"</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-49">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">grid</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">false</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-50">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"partial sum"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">domain</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">grid</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-51">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb3-52">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ruleY</span>([target]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"currentColor"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">strokeDasharray</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4 4"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">strokeOpacity</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-53">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">line</span>(d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> ({n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">s</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> k))}))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-54">      {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e3a21a"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">strokeWidth</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>})</span>
<span id="cb3-55">  ]</span>
<span id="cb3-56">})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="expression">

</div>
</div>
</div>
<p>The last number, <em>error × N</em>, approaches <img src="https://latex.codecogs.com/png.latex?1">. That follows from comparing the tail with an integral: <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bn%20%3E%20N%7D%20n%5E%7B-2%7D%20%5Capprox%20%5Cint_N%5E%5Cinfty%20x%5E%7B-2%7D%5Cdd%20x%20=%201/N">.</p>
</section>
<section id="the-proof-fourier-series-and-parsevals-identity" class="level2">
<h2 class="anchored" data-anchor-id="the-proof-fourier-series-and-parsevals-identity">The proof: Fourier series and Parseval’s identity</h2>
<p>The idea is to compute one integral in two different ways. The <img src="https://latex.codecogs.com/png.latex?%5Cpi"> will come from the length of the interval <img src="https://latex.codecogs.com/png.latex?%5B-%5Cpi,%20%5Cpi%5D">.</p>
<div id="thm-parseval" class="theorem">
<p><span class="theorem-title"><strong>Theorem 1 (Parseval)</strong></span> If <img src="https://latex.codecogs.com/png.latex?f%20%5Ccolon%20%5B-%5Cpi,%20%5Cpi%5D%20%5Cto%20%5CR"> is square-integrable with Fourier series <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7Ba_0%7D%7B2%7D%20+%20%5Csum_%7Bn%20%5Cge%201%7D%20%5Cbig(a_n%20%5Ccos%20nx%20+%20b_n%20%5Csin%20nx%5Cbig)">, then <img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B1%7D%7B%5Cpi%7D%20%5Cint_%7B-%5Cpi%7D%5E%7B%5Cpi%7D%20f(x)%5E2%20%5Cdd%20x%20%5C;=%5C;%20%5Cfrac%7Ba_0%5E2%7D%7B2%7D%20+%20%5Csum_%7Bn=1%7D%5E%7B%5Cinfty%7D%20%5Cleft(a_n%5E2%20+%20b_n%5E2%5Cright).%0A"></p>
</div>
<p>This is the Pythagorean theorem in infinitely many dimensions: the functions <img src="https://latex.codecogs.com/png.latex?%5Ctfrac%7B1%7D%7B%5Csqrt%202%7D,%20%5Ccos%20nx,%20%5Csin%20nx"> form an orthonormal basis for the inner product <img src="https://latex.codecogs.com/png.latex?%5Cinner%7Bf%7D%7Bg%7D%20=%20%5Cfrac1%5Cpi%5Cint_%7B-%5Cpi%7D%5E%7B%5Cpi%7D%20fg">, and the squared length of a vector is the sum of the squares of its coordinates.</p>
<div id="thm-basel" class="theorem">
<p><span class="theorem-title"><strong>Theorem 2 (Euler, 1734)</strong></span> <img src="https://latex.codecogs.com/png.latex?%5Cdisplaystyle%5Csum_%7Bn=1%7D%5E%5Cinfty%20%5Cfrac1%7Bn%5E2%7D%20=%20%5Cfrac%7B%5Cpi%5E2%7D%7B6%7D."></p>
</div>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span>Take <img src="https://latex.codecogs.com/png.latex?f(x)%20=%20x"> on <img src="https://latex.codecogs.com/png.latex?%5B-%5Cpi,%20%5Cpi%5D">. It’s odd, so <img src="https://latex.codecogs.com/png.latex?a_n%20=%200"> for all <img src="https://latex.codecogs.com/png.latex?n">. Integrating by parts, <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0Ab_n%20%5C;=%5C;%20%5Cfrac%7B1%7D%7B%5Cpi%7D%5Cint_%7B-%5Cpi%7D%5E%7B%5Cpi%7D%20x%20%5Csin%20nx%20%5Cdd%20x%0A&amp;%5C;=%5C;%20%5Cfrac%7B2%7D%7B%5Cpi%7D%5Cleft%5B-%5Cfrac%7Bx%5Ccos%20nx%7D%7Bn%7D%5Cright%5D_0%5E%7B%5Cpi%7D%20+%20%5Cfrac%7B2%7D%7B%5Cpi%20n%7D%5Cint_0%5E%5Cpi%20%5Ccos%20nx%20%5Cdd%20x%20%5C%5C%0A&amp;%5C;=%5C;%20%5Cfrac%7B2(-1)%5E%7Bn+1%7D%7D%7Bn%7D.%0A%5Cend%7Baligned%7D%0A"> The left side of Parseval is <img src="https://latex.codecogs.com/png.latex?%5Cfrac1%5Cpi%20%5Cint_%7B-%5Cpi%7D%5E%7B%5Cpi%7D%20x%5E2%20%5Cdd%20x%20=%20%5Cfrac%7B2%5Cpi%5E2%7D%7B3%7D">, so <img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B2%5Cpi%5E2%7D%7B3%7D%20%5C;=%5C;%20%5Csum_%7Bn=1%7D%5E%7B%5Cinfty%7D%20%5Cfrac%7B4%7D%7Bn%5E2%7D,%0A"> and dividing by <img src="https://latex.codecogs.com/png.latex?4"> gives the result.</p>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Euler’s original argument
</div>
</div>
<div class="callout-body-container callout-body">
<p>Euler compared the Taylor series of <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Csin%20x%7D%7Bx%7D%20=%201%20-%20%5Cfrac%7Bx%5E2%7D%7B6%7D%20+%20%5Ccdots"> with the product <img src="https://latex.codecogs.com/png.latex?%5Cprod_%7Bn%5Cge1%7D%5Cleft(1%20-%20%5Cfrac%7Bx%5E2%7D%7Bn%5E2%5Cpi%5E2%7D%5Cright)"> over its roots, and matched the <img src="https://latex.codecogs.com/png.latex?x%5E2"> coefficients. The product formula was not fully justified until Weierstrass, more than a century later, but the answer was right.</p>
</div>
</div>
</section>
<section id="the-same-trick-gives-more-sums" class="level2">
<h2 class="anchored" data-anchor-id="the-same-trick-gives-more-sums">The same trick gives more sums</h2>
<p>Using <img src="https://latex.codecogs.com/png.latex?f(x)%20=%20x%5E2"> in Parseval gives <img src="https://latex.codecogs.com/png.latex?%5Czeta(4)%20=%20%5Csum%20n%5E%7B-4%7D%20=%20%5Cpi%5E4/90">, and higher even powers of <img src="https://latex.codecogs.com/png.latex?x"> give every <img src="https://latex.codecogs.com/png.latex?%5Czeta(2k)"> as a rational multiple of <img src="https://latex.codecogs.com/png.latex?%5Cpi%5E%7B2k%7D">. The odd values are different. Apéry proved in 1978 that <img src="https://latex.codecogs.com/png.latex?%5Czeta(3)"> is irrational, but no closed form for it is known.</p>



</section>

<div class="quarto-listing quarto-listing-container-custom" id="listing-am-post-index">
<div id="am-post-index" hidden="" data-posts="JTVCJTdCJTIydGl0bGUlMjIlM0ElMjJXaHklMjB0aGUlMjBVbGFtJTIwc3BpcmFsJTIwaGFzJTIwZGlhZ29uYWxzJTIyJTJDJTIycGF0aCUyMiUzQSUyMnBvc3RzJTJGdWxhbS1kaWFnb25hbHMlMkZpbmRleC5odG1sJTIyJTJDJTIyZGF0ZSUyMiUzQSUyMjIwMjYtMTEtMDElMjIlMkMlMjJjYXRlZ29yaWVzJTIyJTNBJTVCJTIyTnVtYmVyJTIwVGhlb3J5JTIyJTJDJTIyVmlzdWFsJTIyJTVEJTJDJTIyc2VyaWVzJTIyJTNBJTIyTG9va2luZyUyMGF0JTIwcHJpbWVzJTIyJTJDJTIyY291cnNlJTIyJTNBbnVsbCUyQyUyMmxlY3R1cmUlMjIlM0FudWxsJTdEJTJDJTdCJTIydGl0bGUlMjIlM0ElMjJUaHJlZSUyMHByb29mcyUyMHRoYXQlMjB0aGVyZSUyMGFyZSUyMGluZmluaXRlbHklMjBtYW55JTIwcHJpbWVzJTIyJTJDJTIycGF0aCUyMiUzQSUyMnBvc3RzJTJGaW5maW5pdGVseS1tYW55LXByaW1lcyUyRmluZGV4Lmh0bWwlMjIlMkMlMjJkYXRlJTIyJTNBJTIyMjAyNi0xMC0xMiUyMiUyQyUyMmNhdGVnb3JpZXMlMjIlM0ElNUIlMjJOdW1iZXIlMjBUaGVvcnklMjIlMkMlMjJQcm9vZnMlMjIlNUQlMkMlMjJzZXJpZXMlMjIlM0ElMjJMb29raW5nJTIwYXQlMjBwcmltZXMlMjIlMkMlMjJjb3Vyc2UlMjIlM0FudWxsJTJDJTIybGVjdHVyZSUyMiUzQW51bGwlN0QlNUQ="></div>

<div class="listing-no-matching d-none">No matching items</div>
</div><a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><div class="code-copy-outer-scaffold"><pre class="sourceCode quarto-appendix-bibtex code-with-copy"><code class="sourceCode bibtex">@online{2026,
  author = {, Antony},
  title = {The {Basel} Problem, and Where the π Comes From},
  date = {2026-10-26},
  url = {https://antonyp.com/posts/basel-problem/},
  langid = {en}
}
</code></pre></div><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-2026" class="csl-entry quarto-appendix-citeas">
Antony. 2026. <span>“The Basel Problem, and Where the π Comes
From.”</span> October 26. <a href="https://antonyp.com/posts/basel-problem/">https://antonyp.com/posts/basel-problem/</a>.
</div></div></section></div> ]]></description>
  <category>Analysis</category>
  <category>Infinite Series</category>
  <guid>https://antonyp.com/posts/basel-problem/</guid>
  <pubDate>Mon, 26 Oct 2026 00:00:00 GMT</pubDate>
  <media:content url="https://antonyp.com/posts/basel-problem/card.png" medium="image" type="image/png"/>
</item>
<item>
  <title>Three proofs that there are infinitely many primes</title>
  <dc:creator>Antony </dc:creator>
  <link>https://antonyp.com/posts/infinitely-many-primes/</link>
  <description><![CDATA[ 





<div id="am-page" hidden="" data-kind="post" data-src="posts/infinitely-many-primes/index.qmd" data-series="Looking at primes"></div>
<p>Few theorems have been proved as many ways as this one. Each proof below is short, but they come from very different parts of mathematics, and each one shows something new about why primes cannot run out.</p>
<div id="thm-euclid" class="theorem">
<p><span class="theorem-title"><strong>Theorem 1 (Euclid)</strong></span> There are infinitely many prime numbers.</p>
</div>
<section id="euclid-multiply-and-add-one" class="level2 page-columns page-full">
<h2 class="anchored" data-anchor-id="euclid-multiply-and-add-one">Euclid: multiply and add one</h2>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span>Suppose <img src="https://latex.codecogs.com/png.latex?p_1,%20p_2,%20%5Cdots,%20p_k"> is any finite list of primes, and put <img src="https://latex.codecogs.com/png.latex?%0AN%20=%20p_1%20p_2%20%5Ccdots%20p_k%20+%201.%0A"> Since <img src="https://latex.codecogs.com/png.latex?N%20%3E%201">, it has at least one prime factor <img src="https://latex.codecogs.com/png.latex?q">. If <img src="https://latex.codecogs.com/png.latex?q"> were some <img src="https://latex.codecogs.com/png.latex?p_i">, then <img src="https://latex.codecogs.com/png.latex?q"> would divide both <img src="https://latex.codecogs.com/png.latex?N"> and <img src="https://latex.codecogs.com/png.latex?p_1%20%5Ccdots%20p_k">, hence their difference <img src="https://latex.codecogs.com/png.latex?1">, which is absurd. So <img src="https://latex.codecogs.com/png.latex?q"> is a prime missing from the list, and no finite list contains every prime.</p>
</div>
<p>People often say Euclid argued by contradiction, but notice that the argument is constructive: give it any finite set of primes and it hands back a new one.<sup>1</sup></p>
<div class="no-row-height column-margin column-container"><div id="fn1"><p><sup>1</sup>&nbsp;Starting from <img src="https://latex.codecogs.com/png.latex?%5C%7B2%5C%7D"> and always taking the <em>smallest</em> new prime factor gives the Euclid–Mullin sequence <img src="https://latex.codecogs.com/png.latex?2,%203,%207,%2043,%2013,%2053,%205,%20%5Cdots">. Nobody knows whether every prime eventually appears in it.</p></div></div></section>
<section id="euler-the-harmonic-series-diverges" class="level2">
<h2 class="anchored" data-anchor-id="euler-the-harmonic-series-diverges">Euler: the harmonic series diverges</h2>
<p>Euler’s proof gives much more than infinitude. It shows that the primes are <em>dense enough</em> that the sum of their reciprocals diverges.</p>
<div id="lem-euler-product" class="theorem lemma">
<p><span class="theorem-title"><strong>Lemma 1</strong></span> For any finite set of primes <img src="https://latex.codecogs.com/png.latex?S"> and any <img src="https://latex.codecogs.com/png.latex?N"> such that every integer <img src="https://latex.codecogs.com/png.latex?n%20%5Cle%20N"> has all of its prime factors in <img src="https://latex.codecogs.com/png.latex?S">, <img src="https://latex.codecogs.com/png.latex?%0A%5Cprod_%7Bp%20%5Cin%20S%7D%20%5Cfrac%7B1%7D%7B1%20-%201/p%7D%20%5C;%5Cge%5C;%20%5Csum_%7Bn=1%7D%5E%7BN%7D%20%5Cfrac%7B1%7D%7Bn%7D.%0A"></p>
</div>
<div class="proof" data-collapse="true">
<p><span class="proof-title"><em>Proof</em>. </span>Expand each factor as a geometric series, <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B1-1/p%7D%20=%201%20+%20%5Cfrac1p%20+%20%5Cfrac1%7Bp%5E2%7D%20+%20%5Ccdots">, and multiply out. Every term of the product is <img src="https://latex.codecogs.com/png.latex?1/n"> for some integer <img src="https://latex.codecogs.com/png.latex?n"> built from primes in <img src="https://latex.codecogs.com/png.latex?S">, and by unique factorisation each such <img src="https://latex.codecogs.com/png.latex?n"> appears exactly once. Every <img src="https://latex.codecogs.com/png.latex?n%20%5Cle%20N"> is one of them, and all terms are positive.</p>
</div>
<div class="proof">
<p><span class="proof-title"><em>Proof</em> (Proof of Theorem&nbsp;1). </span>If <img src="https://latex.codecogs.com/png.latex?S"> were the set of <em>all</em> primes, Lemma&nbsp;1 would hold for every <img src="https://latex.codecogs.com/png.latex?N">. The left side is a fixed finite number, but the harmonic series on the right is unbounded, since <img src="https://latex.codecogs.com/png.latex?%0A%5Csum_%7Bn=1%7D%5E%7B2%5Em%7D%20%5Cfrac1n%20%5C;%5Cge%5C;%201%20+%20%5Cfrac%7Bm%7D%7B2%7D.%0A"> This is a contradiction.</p>
</div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Going further
</div>
</div>
<div class="callout-body-container callout-body">
<p>Taking logarithms in Euler’s argument gives <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bp%20%5Cle%20x%7D%20%5Cfrac1p%20%5Cge%20%5Clog%5Clog%20x%20-%201">, so <img src="https://latex.codecogs.com/png.latex?%5Csum_p%201/p"> diverges. The squares are “sparser” than the primes in this sense, since <img src="https://latex.codecogs.com/png.latex?%5Csum%201/n%5E2"> converges.</p>
</div>
</div>
</section>
<section id="fürstenberg-topology-on-z" class="level2">
<h2 class="anchored" data-anchor-id="fürstenberg-topology-on-z">Fürstenberg: topology on <img src="https://latex.codecogs.com/png.latex?%5CZ"></h2>
<p>In 1955, as an undergraduate, Hillel Fürstenberg published a proof that sounds like a joke and isn’t.</p>
<div id="def-evenly-spaced" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 1 (Evenly spaced topology)</strong></span> For <img src="https://latex.codecogs.com/png.latex?a,%20b%20%5Cin%20%5CZ"> with <img src="https://latex.codecogs.com/png.latex?b%20%5Cge%201">, let <img src="https://latex.codecogs.com/png.latex?S(a,b)%20=%20%5Cset%7Ba%20+%20nb%20:%20n%20%5Cin%20%5CZ%7D">. Call a set <img src="https://latex.codecogs.com/png.latex?U%20%5Csubseteq%20%5CZ"> <em>open</em> if it is a union of such progressions (the empty set included).</p>
</div>
<p>It’s quick to check this is a topology: the intersection of two progressions is either empty or another progression, with step equal to the <img src="https://latex.codecogs.com/png.latex?%5Clcm"> of the two steps. Two features matter:</p>
<ol type="1">
<li>Every non-empty open set is infinite, since it contains a whole progression.</li>
<li>Every <img src="https://latex.codecogs.com/png.latex?S(a,b)"> is also <strong>closed</strong>, because its complement is a union of the progressions <img src="https://latex.codecogs.com/png.latex?S(a+i,%20b)"> with <img src="https://latex.codecogs.com/png.latex?1%20%5Cle%20i%20%3C%20b">.</li>
</ol>
<div class="proof">
<p><span class="proof-title"><em>Proof</em> (Proof of Theorem&nbsp;1). </span>Every integer except <img src="https://latex.codecogs.com/png.latex?%5Cpm%201"> has a prime factor, so <img src="https://latex.codecogs.com/png.latex?%0A%5CZ%20%5Csetminus%20%5Cset%7B-1,%201%7D%20%5C;=%5C;%20%5Cbigcup_%7Bp%20%5Ctext%7B%20prime%7D%7D%20S(0,%20p).%0A"> If there were finitely many primes, the right side would be a finite union of closed sets, hence closed. Then <img src="https://latex.codecogs.com/png.latex?%5Cset%7B-1,%201%7D"> would be open. But it is non-empty and finite, which contradicts feature 1.</p>
</div>
</section>
<section id="what-each-proof-shows" class="level2">
<h2 class="anchored" data-anchor-id="what-each-proof-shows">What each proof shows</h2>
<table class="table-striped caption-top table">
<caption>Three proofs, side by side</caption>
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Proof</th>
<th style="text-align: left;">Main idea</th>
<th style="text-align: left;">What you get beyond infinitude</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Euclid</td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?p_1%20%5Ccdots%20p_k%20+%201"> has a new prime factor</td>
<td style="text-align: left;">An explicit bound: the <img src="https://latex.codecogs.com/png.latex?(k%7B+%7D1)">-th prime is at most <img src="https://latex.codecogs.com/png.latex?p_1%20%5Ccdots%20p_k%20+%201"></td>
</tr>
<tr class="even">
<td style="text-align: left;">Euler</td>
<td style="text-align: left;">Unique factorisation + divergence</td>
<td style="text-align: left;"><img src="https://latex.codecogs.com/png.latex?%5Csum%201/p%20=%20%5Cinfty">, and the start of analytic number theory</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Fürstenberg</td>
<td style="text-align: left;">Topology of arithmetic progressions</td>
<td style="text-align: left;">Not much, but it’s a good example of switching languages</td>
</tr>
</tbody>
</table>
<p>Fürstenberg’s proof is often described as Euclid’s in disguise: strip out the topology and what’s left is an argument about integers coprime to a finite product of primes. That kind of thing is common in mathematics: changing the language of a proof can make it look completely new.</p>



</section>


<div class="quarto-listing quarto-listing-container-custom" id="listing-am-post-index">
<div id="am-post-index" hidden="" data-posts="JTVCJTdCJTIydGl0bGUlMjIlM0ElMjJXaHklMjB0aGUlMjBVbGFtJTIwc3BpcmFsJTIwaGFzJTIwZGlhZ29uYWxzJTIyJTJDJTIycGF0aCUyMiUzQSUyMnBvc3RzJTJGdWxhbS1kaWFnb25hbHMlMkZpbmRleC5odG1sJTIyJTJDJTIyZGF0ZSUyMiUzQSUyMjIwMjYtMTEtMDElMjIlMkMlMjJjYXRlZ29yaWVzJTIyJTNBJTVCJTIyTnVtYmVyJTIwVGhlb3J5JTIyJTJDJTIyVmlzdWFsJTIyJTVEJTJDJTIyc2VyaWVzJTIyJTNBJTIyTG9va2luZyUyMGF0JTIwcHJpbWVzJTIyJTJDJTIyY291cnNlJTIyJTNBbnVsbCUyQyUyMmxlY3R1cmUlMjIlM0FudWxsJTdEJTJDJTdCJTIydGl0bGUlMjIlM0ElMjJUaGUlMjBCYXNlbCUyMHByb2JsZW0lMkMlMjBhbmQlMjB3aGVyZSUyMHRoZSUyMCVDRiU4MCUyMGNvbWVzJTIwZnJvbSUyMiUyQyUyMnBhdGglMjIlM0ElMjJwb3N0cyUyRmJhc2VsLXByb2JsZW0lMkZpbmRleC5odG1sJTIyJTJDJTIyZGF0ZSUyMiUzQSUyMjIwMjYtMTAtMjYlMjIlMkMlMjJjYXRlZ29yaWVzJTIyJTNBJTVCJTIyQW5hbHlzaXMlMjIlMkMlMjJJbmZpbml0ZSUyMFNlcmllcyUyMiU1RCUyQyUyMnNlcmllcyUyMiUzQW51bGwlMkMlMjJjb3Vyc2UlMjIlM0FudWxsJTJDJTIybGVjdHVyZSUyMiUzQW51bGwlN0QlNUQ="></div>

<div class="listing-no-matching d-none">No matching items</div>
</div><a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><div class="code-copy-outer-scaffold"><pre class="sourceCode quarto-appendix-bibtex code-with-copy"><code class="sourceCode bibtex">@online{2026,
  author = {, Antony},
  title = {Three Proofs That There Are Infinitely Many Primes},
  date = {2026-10-12},
  url = {https://antonyp.com/posts/infinitely-many-primes/},
  langid = {en}
}
</code></pre></div><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-2026" class="csl-entry quarto-appendix-citeas">
Antony. 2026. <span>“Three Proofs That There Are Infinitely Many
Primes.”</span> October 12. <a href="https://antonyp.com/posts/infinitely-many-primes/">https://antonyp.com/posts/infinitely-many-primes/</a>.
</div></div></section></div> ]]></description>
  <category>Number Theory</category>
  <category>Proofs</category>
  <guid>https://antonyp.com/posts/infinitely-many-primes/</guid>
  <pubDate>Mon, 12 Oct 2026 00:00:00 GMT</pubDate>
  <media:content url="https://antonyp.com/posts/infinitely-many-primes/card.png" medium="image" type="image/png"/>
</item>
</channel>
</rss>
