- Python 3
pip install inflect
pip install csv
Interestingly, if you perform the following procedure, you will always arrive at the number 4 (at least in the English language):
- Begin with an arbitrary integer
- Spell out the integer in words
- Count the number of letters in the word-form of the number
- Return to step (2) with the result from step (3) and continue until you reach 4
For example, beginning with the number 10:
- 10 spelled out is "ten," which has 3 letters
- 3 spelled out is "three," which has 5 letters
- 5 spelled out is "five," which has 4 letters
- 4 spelled out is "four," which has 4 letters
...
If you continue repeating this process, you will always arrive at the number 4.
4 is "cosmic" because it is the only number which has the same number of letters as its numerical value.
First, to show this works with all positive numbers:
Each of these numbers leads back to 4:
- 1 -> 3 -> 5 -> 4
- 2 -> 3 -> 5 -> 4
- 3 -> 5 -> 4
- 4 -> 4 -> ...
Assume that n>4
and for all 0<i<n
, i
will lead back to 4. Consider n+1
.
For all n>4
, the number of letters in the word-form of that number is less than the numerical value of the number.[by the lemma below] n+1
will thus lead to a smaller (positive) number, and, by induction, one that also leads back to 4.
QED
To put it in simpler terms, each iteration gets closer and closer to the number 4 (by shrinking the number that iteration started with). A number can't have a negative number of letters (nor zero letters), so this means that the process produces smaller and smaller positive integers until it eventually produces either a 1, 2, 3, or 4, all of which lead back to 4, as shown above.
As for other special cases:
- 0 -> 4
- negative numbers -> some positive number -> ... (as shown above) -> 4
(for n > 4)
The letter-count increases significantly every time a new decimal place is reach, since an additional "hundred", "thousand", etc. must be added to the number's word form. This increase is no more than twenty letters for every power of 10 which is reached. Thus, the letter-count increases roughly logarithmically with respect to the numerical value of the numbers, and thus is always less than its numerical value.
The following charts show the result of performing the above process once per number from 0 to 100 and from 0 to 10000, respectively. As you can see, as numbers grow larger, the number of letters in their spelled-out versions increases very slowly, lending more confidence to the idea that every number will eventually get back to four (as explained above).
(click charts below for interactive versions)