How Many Numbers Have the Same Number of Letters in Their Name as Their Value?

Danil Vityazev
3 min readSep 18, 2021
A word chain for the English language

This project is inspired by this five-year-old Matt Parker’s video.

Long story short, Matt suggests exploring the following sequences:

  1. You start with any number you want
  2. You count the number of letters in the word representing this number. This is the next number in your sequence. Of cause, the sequence will be different for different languages.

There are two basic options for how the sequence can terminate. You either hit a number that has the same number of letters in its word, therefore you get stuck there, or there is a loop and you end up in this loop after hitting any number in it.

In English, the sequence is quite boring. There is only one terminal number which is 4. 4 has exactly 4 letters in its word “f-o-u-r” so it leads to itself. And whatever number you start with, you end up in four sooner or later.

Let’s see how the sequence looks in other languages.

The script

To investigate the problem I'm created a script in Python to generate a word chain for all the numbers from 0 to 100. All these sequences can be visualized as a directed graph.

I used num2words library to generate words in different languages and NetworkX to create a directed graph.

Let’s have a look at the code. First of all, we need to define a function that gives us the next number. The function just counts the number of letters in the word representation of a given number, excluding spaces and dashes.

Then all we have to do is just run a cycle for calculating the sequence for all the numbers and adding them to the graph until we hit a number that is already a node.

Pictures

At the beginning of the article, there is a picture of the resulting graph for the English language. It’s clear that all the sequences converge to 4, and 4 leads to itself. But what do we get for other languages?

The French language has a cycle of 3–5–4–6

Above you can see a graph for the French language. Instead of a single terminal node, the French graph has a terminal cycle of 3–5–4–6. All the sequences eventually end up there.

Russian sequence is actually three separate graphs

Russian graph is even more interesting. First of all, it consists of 3 separate graphs, two of them have a single terminal node, 3 and 11. Another one has a terminal cycle of 4–6–5.

Here are some more graphs for different languages:

In Japanese, almost all numbers consist of 3 symbols
Unlike the majority of other languages, Spanish has two graphs that are similar in size.
Norwegian has 3 graphs with similar numbers on nodes in them

What does a word chain look like in your language? Check the Google Colab notebook to find out.

You can also find the code on GitHub.

Here’s another story, where I had some fun with math, python, and game theory.

--

--

Danil Vityazev

PhD candidate, Data Scientist. I make mathematical models of business processes to help people make decisions. vityazevdanil@gmail.com