Showing posts with label Catalan. Show all posts
Showing posts with label Catalan. Show all posts

Sunday, 16 November 2025

The Universe of Catalan Numbers

 I uploaded two of my posts to NotebookLM. The posts were:
The former post was in fact only my third to Mathematical Meanderings and was made over ten years ago now (shortly after I retired at the age of 66). NotebookLM suggested "The Universe of Catalan Numbers" as a title so I've kept it. Here is the URL of the video.


NotebookLM again does a pretty good job at jazzing up the content and making it interesing. It does make an error early on as I explained in my comments to the video:
This video was generated by NotebookLM based on two posts from my mathematical blog, namely Catalan Numbers and Motzkin Numbers. These two posts are my own and AI was not used in their creation. The video doesn't quite get everything right. For example, it says at the outset that \(24285\) is a Catalan number. In fact \(24285\) is NOT a Catalan number but rather the residue after we divide the 15th Catalan number \(9694845\) by \(2^{15}\) as I explain my blog post. Apart from this, the video does a reasonable job of summarising the content of the two blog posts.

This is now the second video I've created from my blog posts and I'll sure I'll continue to generate more.

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

Saturday, 6 June 2020

The Catalan Constant

Today I turned 25977 days old and this number is prime. One of its claims to fame is that it is a member of OEIS A104919:


A104919

Primes from merging of 5 successive digits in decimal expansion of Catalan's constant.


I was familiar with Catalan numbers and in fact posted about them in this post from the 30th of September 2015 and another post from the 15th of April 2018. These numbers, and the eponymous constant, are named in honour of the Belgium mathematician Eugène Catalan. So what is the Catalan constant? It is defined as follows:$$\sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^3} = \frac{1}{1^3} - \frac{1}{3^3} + \frac{1}{5^3} - \frac{1}{7^3} + \frac{1}{9^3} - \cdots$$It is equal to 0.915965594177219015054603514932384110774 ... but the interesting thing is that no one knows whether it is irrational and, if it is, whether it is transcendental. This is odd because a similar looking sequence is known to be transcendental viz.:$$\sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^3} = \frac{1}{1^3} - \frac{1}{3^3} + \frac{1}{5^3} - \frac{1}{7^3} + \frac{1}{9^3} - \cdots = \frac{\pi^3}{32}$$As of July 16th 2019, the Catalan constant is known to 600,000,000,100 decimal places. This site lists the constant to 300,000 decimal places with the introduction:
Catalan constant to 300000 digits computed on September 29, 1996 by using a Sun Ultra-Sparc in 1 day 8 hour 15 min 15 sec 55 hsec. The algorithm used is the standard series for Catalan, accelerated by an Euler transform. The algorithm was implemented using the LiDIA library for computational number theory and it is part of the multiprecision floating-point arithmetic of the package.
This number of decimal places was the record for 1996 and it was more than sufficient for me to generate the OEIS sequence A104919 up to and including 25997. I simply copied a few thousand of the first few digits into a list and applied the SageMath algorithm shown in this permalink.

Of course, the digits can be generated using a wide variety of formulae. One of the best is the following: $$\frac{\pi}{8}\log\left(2 + \sqrt{3}\right) + \frac{3}{8}\sum_{n=0}^\infty \frac{1}{(2n+1)^2 \binom{2n}{n}}$$I tried this but wasn't successful in generating more than the first two members of the sequence so I abandoned this approach and copied and pasted instead! I'm always fascinated by these types of sequences because of their similarity to the famous Riemann zeta function:$$\zeta(s) =\sum_{n=1}^\infty\frac{1}{n^s}$$In fact the summation that generates the Catalan constant is the Dirichlet beta function (also known as the Catalan beta function) and it is closely related to the Riemann zeta function. It is defined as:$$\beta(s) = \sum_{n=0}^\infty \frac{(-1)^n} {(2n+1)^s}$$When \(s=2\), \( \beta(2)\) gives the Catalan constant. You can read more here about the Dirichlet beta function.

Sunday, 15 April 2018

Sum of Squares of Integers and Catalan Numbers

As I began reading a new book Catalan Numbers With Applications by Thomas Koshy, I hadn't progressed far before I came across the statement:$$ \sum_{k=1}^n k^2=\frac{n(n+1)(2n+1)}{6}$$At this point, I had to pause because the author had just assumed this result but I couldn't see how to prove it. I needed to do a little digging but before long I came across an interesting proof of the result on this site. The website starts slowly and works out firstly what the sum of the first n integers will be. Here is how it is worked out: $$ \begin{align} (k-1)^2&=k^2-2k+1\\ \text{Rearranging the terms as below:}\\k^2-(k-1)^2&=2k-1\\ \text{Now sum both sides:}\\ \sum_{k=1}^n (k^2-(k-1)^2)&=2 \sum_{k=1}^n k-\sum_{k=1}^n 1\\n^2&=2S_n-n\\S_n&=\frac{n^2+n}{2}\\&=\frac{n(n+1)}{2} \end{align} $$ After this the website goes on to tackle the sum of the squares of the first n integers as follows (using a similar approach): $$\begin{align} (k-1)^3&=k^3-3k^2+3k+1\\ \text{Rearrange the terms: }\\k^3-(k-1)^3&=3k^2-3k-1\\ \text{Summing both sides:}\\ \sum_{k=1}^n (k^3-(k-1)^3)&=3 \sum_{k=1}^n k^2-3 \sum_{k=1}^n k -\sum_{k=1}^n 1\\n^3&=3 \sum_{k=1}^n k^2 -3 \frac{n(n+1)}{2}-n \\ \sum_{k=1}^n k^2&=\frac{1}{3}n^3+\frac{1}{2}n^2+\frac{1}{6}n\\&=\frac{n(n+1)(2n+1)}{6} \end{align}$$ The website then goes on to establish a general result for the sum of integers raised to any power. The question is asked is there a formula for calculating: $$ 1^a+2^a+3^a+ \cdots + (n-1)^a + n^a=\sum_{k=1}^n k^a \text{ ?} $$Well there is, it's called Faulhaber's Formula and involves Bernoulli numbers but I won't go into that here.

For now, I can go on reading my book about the Catalan numbers. I first made a blog post about Catalan numbers back in 2015 on Tuesday the 29th September. This was the first time I'd really heard of them and I didn't delve deeply into them at all in that post. Hopefully I'll have more to say in later posts about these numbers.

The Catalan numbers are of the form: \( \dfrac{1}{n+1} \dbinom{2n}{n} \)

They can be calculated readily enough:
  • in WolframAlpha using catalannumber[n]
  • in SageMath using catalan_number(n). 
Talking of SageMath, I've installed the latest version (8.1) on my Mac and am making a concerted effort to make more use of it. I first made a blog post about this free, open source software program in 2017 on the 4th of January. It really is quite impressive in its capabilities so hopefully I can become more adept at using it. Here's a screenshot from my SageMath notebook:


Lastly, the mathematician who lent his name to these numbers, Eugène Catalan, shouldn't be ignored. He was born on the 30th of May 1814 in Bruges, French Empire (now Belgium) and died on the 14th February 1894 in Liège, Belgium. A biography can be found at MacTutor History of Mathematics archive along with biographies of a great many other mathematicians and other interesting material. I first came across this archive in the early naughties and was fascinated to read about the lives of famous mathematicians who had lent their names to so many mathematical tools that I'd used in previous years. L'Hôpital's Rule was a case in point. Although widely used and a greatly useful mathematical tool, who knows anything about the impressively named Guillaume François Antoine Marquis de L'Hôpital who lent his name to the rule?

on Sunday, March 28th 2021
layout improved