Showing posts with label peaks. Show all posts
Showing posts with label peaks. Show all posts

Tuesday, 3 November 2026

Visual Display of Numbers: Part 1

In my previous post titled Binary Display, I borrowed an idea from Numbers Aplenty about the visual display of a positive integer expressed in terms of its binary digits. This gave me the idea for a display of the number in terms of its decimal digits. I got Gemini to develop an algorithm to achieve this and Figure 1 shows the result for 28338, my diurnal age today (permalink):


Figure 1

There is a small text-based display:

  | 2   8   3   3   8  
--+--------------------
9 |                    
8 |     ██          ██ 
7 |                    
6 |                    
5 |                    
4 |                    
3 |         ██  ██     
2 | ██                 
1 |                    
0 |                    

The larger diagram below this in the output can then be screen-shot and annotated as shown in Figure 2.


Figure 2

On this basis, the number 28338 might be associated with Twin Peaks (with an intervening valley). This sort of depiction of the digits of a number can be used to visually depict so called \( \textbf{mountain numbers}\) that belong to OEIS A134941. These numbers are defined as:
The first digit is 1. The last digit is 1. The first digits are in increasing order. The last digits are in decreasing order. The numbers only have one largest digit. This sequence is finite. The last term is 12345678987654321. The total number of terms is 21846.
19871 is an example of such a number:

  | 1   9   8   7   1  
--+--------------------
9 |     ██             
8 |         ██         
7 |             ██     
6 |                    
5 |                    
4 |                    
3 |                    
2 |                    
1 | ██              ██ 
0 |                    

There are also generalized mountain numbers described in OEIS A134853 as:
There is only one largest digit which represents the top of the mountain. This sequence is finite. The last member is 123456789876543210. The sequence is a supersequence of A134941, because the restriction that both feet of the mountain are at "sea level" (first and last digit equal 1) is dropped here. There are 173247 terms in this sequence.

28320 is an example of such a number:

  | 2   8   3   2   0  
--+--------------------
9 |                    
8 |     ██             
7 |                    
6 |                    
5 |                    
4 |                    
3 |         ██         
2 | ██          ██     
1 |                    
0 |                 ██  
 

This is just a rough start for a general theme of how to represent a decimal number. I've addressed this issue before in a post titled What Does A Number Look Like from July of 2018. Using the site Numbermatics, the representation of the number 28338 is shown in Figure 3:


Figure 3

The commentary on the display is as follows:

In this visualization, the outer ring segments show the relative proportions of its three prime factors. Inside, the large and small discs symbolize the relationship between these factors (center) and eight divisors.
This representation is more informative and very different to the display shown in Figure 1. I've gotten Gemini to investigate visual representations more using this prompt:

I'm interested in exploring different ways to represent a positive integer such as 28338. Numbermatics (https://numbermatics.com/n/28338) shows one way and the display that I've just gotten Gemini to create shows another. What are some other visual ways to represent numbers that ideally show information not just about the digits but also its factors, divisors etc. Maybe you suggest modifications or improvements to existing methods. See what you can come up with. Links to other sites like Numbermatics can naturally be included in your report.

Using Gemini's Argon set to high level thinking, the response that I got was very comprehensive and I won't attempt to summarise it in this post and I'm still digesting what it came up with. I'll reserve further comment to my next blog post. 

Wednesday, 2 June 2021

The Fine Numbers

The Fine numbers and the Catalan numbers are intimately related. Two manifestations are the identity \(C_n=2F_n+F_{n−1} \text{ where }n \geq 1\), and the generating function identities:$$F(x)=\frac{C(x)}{1 +x \,C(x)} \text{ and }C(x)=\frac{F(x)}{1−x\,F(x)}$$This information is taken from the abstract to this 2001 paper titled A Survey of the Fine Numbers. However, I'm getting ahead of myself. How did I get here? Well, today I turned 26356 days old and one of the sequences to which this number belongs is OEIS A119012:


 A119012

Number of valleys strictly above the x-axis in all hill-free Dyck paths of semilength \(n\) (a hill in a Dyck path is a peak at level 1).


The members of this sequence increase rapidly on the way to 26356 (where \(n=10\), starting from \(n=1\)): 0, 0, 1, 5, 23, 98, 405, 1644, 6604, 26356, ...

The reference to Dyck paths immediately ties this number to the Catalan numbers that I've written about before on two difference occasions:
To quote from the Wikipedia article on Catalan Numbers (\(C-n\) is the \(n\)-th Catalan number):
\(C_n\) is the number of ways to form a "mountain range" with \(n\) upstrokes and \(n\) downstrokes that all stay above a horizontal line. The mountain range interpretation is that the mountains will never go below the horizon.

Figure 1 is the accompanying diagram to the previous text:

Figure 1

The depictions of "mountain ranges" are Dyck paths and can be written textually as:

  • \(n=1\): UD
  • \(n=2\): UDUD and UUDD
  • \(n=3\): UDUDUD, UDUUDD, UUDDUD, UUDUDDD and UUUDDD

The first Catalan numbers for \(n = 0, 1, 2, 3, \dots\) are 1, 1, 2, 5 (see Figure 1), 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, ... .

For Dyck paths, a peak of height one is also known as a hill and is represented as UD. It turns out that the Fine numbers count the number of Dyck paths having no hills. The Fine numbers begin: 1, 0, 1, 2, 6, 18, 57, ... beginning with \(n=0\).

Figure 2 shows the two Dyck paths with no hills for the case \(n=3\).


Figure 2

Getting back to OEIS A119012 (0, 0, 1, 5, 23, ... ) starting with \(n=1\), it can seen that there is only a valley in the case of \(n=3\) and that is confirmed by Figure 2.

There are generating functions for the Catalan numbers, the Fine numbers and the numbers making up OEIS A119012. The generating function for the Catalan numbers is:$$C(x)=\frac{1-\sqrt{1-4x}}{2x}$$For the Fine numbers, the generating function is:$$F(x)=\frac{1-\sqrt{1-4x}}{x\,(3-\sqrt{1-4x})}$$For OEIS A119012, the generating function is:$$G(x)= \frac{2 \left (1-3x-(1-x)\sqrt{1-4x}\right )}{\left (1+2x+\sqrt{1-4x}\right )^{2}\sqrt{1-4x}}$$Figure 3 shows the SageMath code for these generating functions:


Figure 3: permalink