News

johndcook.com
johndcook.com > blog > 04/01/2026 > truncated-triangular-numbers

Pentagonal numbers are truncated triangular numbers

3+ hour, 58+ min ago  (105+ words) Pentagonal numbers are truncated triangular numbers. You can take the diagram that illustrates the'nth pentagonal number and warp it into the base of the image that illustrates the (2n " 1)st triangular number. If you added a diagram for the (n " 1)st…...

johndcook.com
johndcook.com > blog > 03/31/2026 > quantum-y2k

Quantum Y2K

1+ day, 2+ hour ago  (350+ words) I'm skeptical that quantum computing will become practical in the next 100 years. However, if it does become practical and we don't prepare, the world's financial system could collapse. Everyone agrees we should prepare for quantum computing, even those of us…...

johndcook.com
johndcook.com > blog > 03/31/2026 > morse-code-tree

Morse code tree

1+ day, 5+ hour ago  (146+ words) Peter Vogel posted the following image on X yesterday. The receive side of the coin is a decision tree for decoding Morse code. The shape is what makes this one interesting. Decision trees are typically not very compact. Each branch…...

johndcook.com
johndcook.com > blog > 03/27/2026 > an-ai-odyssey-part-3-lost-needle-in-the-haystack

An AI Odyssey, Part 3: Lost Needle in the Haystack

5+ day, 1+ hour ago  (175+ words) While shopping on a major e-commerce site, I wanted to get an answer to an obscure question about a certain product. Not finding the answer immediately on the product page, I thought I'd try clicking the AI shopping assistant helper…...

johndcook.com
johndcook.com > blog > 03/27/2026 > complex-argument

Computing sine and cosine of complex arguments with only real functions

5+ day, 5+ hour ago  (124+ words) Suppose you have a calculator or math library that only handles real arguments but you need to evaluate sin(3 + 4i). What do you do? If you're using Python, for example, and you don't have NumPy installed, you can use the built-in…...

johndcook.com
johndcook.com > blog > 03/26/2026 > lebesgue-constants

Lebesgue constants

5+ day, 21+ hour ago  (232+ words) I alluded to Lebesgue constants in the previous post without giving them a name. There I said that the bound on order n'interpolation error has the form where'h is the spacing between interpolation points and " is the error in the…...

johndcook.com
johndcook.com > blog > 03/26/2026 > table-precision

How much precision can you squeeze out of a table?

6+ day, 2+ hour ago  (381+ words) Richard Feynman said that almost everything becomes interesting if you look into it deeply enough. Looking up numbers in a table is certainly not interesting, but it becomes more interesting when you dig into how well you can fill in…...

johndcook.com
johndcook.com > blog > 03/24/2026 > from-mendeleev-to-fourier

From Mendeleev to Fourier

1+ week, 1+ day ago  (133+ words) The previous post looked at an inequality discovered by Dmitri Mendeleev and generalized by Andrey Markov: Theorem (Markov): If P(x) is a real polynomial of degree'n, and |P(x)| " 1 on [1, 1] then |P(x)| "n" on [1, 1]. If'P(x) is a trigonometric polynomial then Bernstein…...

johndcook.com
johndcook.com > blog > 03/24/2026 > mendeleevs-inequality

Mendeleev’s inequality

1+ week, 1+ day ago  (231+ words) Dmitri Mendeleev is best known for creating the first periodic table of chemical elements. He also discovered an interesting mathematical theorem. Empirical research led him to a question about interpolation, which in turn led him to a theorem about polynomials…...

johndcook.com
johndcook.com > blog > 03/23/2026 > intersection-difference

Set intersection and difference at the command line

1+ week, 2+ day ago  (166+ words) A few years ago I wrote about comm, a utility that lets you do set theory at the command line. It's a really useful little program, but it has two drawbacks: the syntax is hard to remember, and the input…...