Choose a number from 1 to 99

We describe a simple procedure. We choose a natural number N from 1 to 99 and compare it with a number equal to the number of letters in the record N in the form of a word of some language. For the resulting number, repeat this operation again. For the Russian language, a pretty nice tree is obtained, in which there are three cycles 3 → 3, 11 → 11 and 6 → 5 → 4 → 6.

image


Interestingly, in English, in no more than five steps, we come to 4 and go in cycles.
Here is an example of a short Ruby code producing the graph we need for English
require 'humanize'
require 'rgl/adjacency'
require 'rgl/dot'
result = RGL::DirectedAdjacencyGraph.new
1.upto(99) { |i|
	result.add_edge(i.to_s, i.humanize(locale: :en).length.to_s)
}
result.dotty




The code for the French language is similarly arranged
result = RGL::DirectedAdjacencyGraph.new
1.upto(99) { |i|
	result.add_edge(i.to_s, i.humanize(locale: :fr).length.to_s)
}
result.dotty

In this case, we come to the cycle 5 → 4 → 6 → 3 → 5.

Also popular now: