Showing posts with label Wolfram Alpha. Show all posts
Showing posts with label Wolfram Alpha. Show all posts

Wednesday, 3 April 2024

On Turning 75

On April 3rd 2024, I turned 75 years old. I like the graphic above that is meant to represent 75%. This translates nicely into years as well, because the maximum span of human life is more or less 100 years and so I've reached 3/4 of that milestone. The only question is how far along the remaining 1/4 will I progress before being cut short.

According to Wolfram Alpha, I have a 50% chance of making it halfway. See Figure 1.


Figure 1

87.5 is the halfway point between 75 and 100. 87.22 is just shy of that. So 50% of my cohort of Australian males will make it to that mark and 50% won't. That's the cold, stark statistic. 25 years is commonly regarded as a generation and so three generations are now behind me. Here is a link to a PDF fact sheet about the number 75 titled Importance Of Number 75 In Mathematics and Other Fields.

Looking at the information about 75 on Numbers Aplenty however, we find more interesting facts. For example, I discovered that it forms a betrothed pair with 48 and that together they form the first such betrothed pair. I'd not heard of this term before but it's defined as follows:

Two numbers \( (m,n) \)  form a betrothed pair if the sum of nontrivial divisors of one number equals the other, i.e., if  \( \sigma(n)-n-1= m\)  and  \(\sigma(m)-m-1 = n\).

The initial pairs are (48, 75), (140, 195), (1050, 1925), (1575, 1648), (2024, 2295), (5775, 6128), (8892, 16587), (9504, 20735), (62744, 75495), (186615, 206504).

The same source informed me that 75 is a repfigit number defined as follows:

Let  \(n\)  be a number with  \(k\)  digits. Let us define a Fibonacci-like sequence using as seeds the digits of  \(n\)  and then at each step adding the last  \(k\)  terms. If  \(n\)  itself appears in the sequence, then it is a repfigit number.

The term repfigit is short for repetitive Fibonacci-like digit and such numbers are also named Keith numbers (Wikipedia link).

For example, 1104 is a repfigit or Keith number because the resulting sequence 1, 1, 0, 4, 6, 11, 21, 42, 80, 154, 297, 573, 1104, contains 1104.

Note that the 6 repfigit numbers with 2 digits are, by definition, fibodiv numbers, too.

The first repfigit numbers are 14, 19, 28, 47, 61, 75, 197, 742, 1104, 1537, 2208, 2580, 3684, 4788, 7385, 7647, 7909, 31331, 34285, 34348, 55604, 62662, 86935, 93993, 120284 

See my blog post titled Fibodiv Numbers to find out what they are about. In the case of 75, a two digit number, we have 7, 5, 12, 17, 29, 46, 75 and thus it qualifies.

75 is also a trimorphic number defined as a number \(n\) such that \(n^3\) ends in \(n\). Thus we have:$$75^3=421875$$The initial trimorphic numbers are: 1, 4, 5, 6, 9, 24, 25, 49, 51, 75, 76, 99, 125, 249, 251, 375, 376, 499, 501, 624, 625, 749, 751, 875, 999. It can be noted that 76 is also trimorphic:$$76^3=438976$$My age in days is 27394 which factorises to 2 x 13697 and thus my life can be divided into exactly two halves, each of length 13697 days. I turned this number of days old on October 3rd 1986. The number 27394 has the property that it is equal to 163 x 167 + 173 where 163, 167 and 173 are successive primes. The initial numbers with this property are:

11, 22, 46, 90, 160, 240, 346, 466, 698, 936, 1188, 1560, 1810, 2074, 2550, 3188, 3666, 4158, 4830, 5262, 5850, 6646, 7484, 8734, 9900, 10510, 11130, 11776, 12444, 14482, 16774, 18086, 19192, 20862, 22656, 23870, 25758, 27394, 29070, 31148, 32590, 34764, 37060, 38220, 39414, 42212

These numbers form part of OEIS A292926.

Thursday, 9 February 2023

A Property of the Determinant of a Circulant Matrix

 I've written about the circulant matrix only twice before in the following posts:

Today, with my diurnal age being 26975, I was struggling to find some interesting properties for this number and my thoughts fell to testing whether the sum of its digits divided the determinant of its circulant matrix. It did. I tested for other numbers and to my surprise this was always the case. What is going on?

Well, it all becomes clear when we consider generalised 2 x 2 circulant matrix (ignoring the trivial case of one digit numbers). Let's start with a generalised two digit number. Let's call it \(ab\). This number produces the circulant matrix shown in Figure 1.

Figure 1

This matrix has a determinant of \(a^2-b^2=(a+b)(a-b) \) and thus \(a+b\) will always divide it. Let's now consider a three digit number \(abc\) with sum of digits \(a+b+c\). It's circulant matrix is shown in Figure 2.

Figure 2

The determinant of this matrix is:$$a^3 - 3 a b c + b^3 + c^3\\ = (a + b + c) (a^2 - a b - a c + b^2 - b c + c^2)$$Once again, \(a+b+c\) will always divide this determinant. Let's look at a four digit number \(abcd\) with sum of digits \(a+b+c+d\). The circulant matrix is shown in Figure 3.

Figure 3

The determinant of this matrix is:$$ \begin{align} a^4 - 4 a^2 b d - 2 a^2 c^2 + 4 a b^2 c + 4 a c d^2 - b^4 + 2 b^2 d^2 - 4 b c^2 d + c^4 - d^4\\=(a - b + c - d) (a + b + c + d) (a^2 - 2 a c + b^2 - 2 b d + c^2 + d^2) \end{align} $$Once again, \(a+b+c+d\) will always divide this determinant. I won't go any further nor attempt a completely generalised proof but it seems apparent that the sum of the digits of any number will always divide the determinant of the number's circulant matrix. A surprising and interesting result.


Figure 4

I give credit to Wolfram Alpha for quickly calculating the determinants and factorising them.


Figure 5

In fact, I felt guilty after using Wolfram Alpha, because I knew SageMath could do the job just as well. So here is the latter's handling of the generalised five digit number \(abcde\). Figure 6 shows the number' circulant matrix:


Figure 6: permalink

Here is the determinant of this matrix:$$ \begin{align} a^5 + b^5 - 5ab^3c + 5a^2bc^2 + c^5\\ + 5a^2b^2d - 5a^3cd - 5bc^3d + 5b^2cd^2 + 5ac^2d^2\\ - 5abd^3 + d^5 - 5a^3be + 5b^2c^2e - 5ac^3e\\ - 5b^3de - 5abcde + 5a^2d^2e - 5cd^3e + 5ab^2e^2\\ + 5a^2ce^2 + 5c^2de^2 + 5bd^2e^2 - 5bce^3 - 5ade^3 + e^5 \end{align}$$This factorises to:$$ \begin{align} (a^4 - a^3b + a^2b^2 - ab^3\\ + b^4 - a^3c + 2a^2bc - 3ab^2c - b^3c\\ + a^2c^2 + 2abc^2 + b^2c^2 - ac^3 - bc^3\\ + c^4 - a^3d + 2a^2bd + 2ab^2d - b^3d\\ - 3a^2cd - abcd + 2b^2cd + 2ac^2d - 3bc^2d\\- c^3d + a^2d^2 - 3abd^2 + b^2d^2 + 2acd^2\\ + 2bcd^2 + c^2d^2 - ad^3 - bd^3 - cd^3 + d^4 \\- a^3e - 3a^2be + 2ab^2e - b^3e + 2a^2ce\\ - abce + 2b^2ce - 3ac^2e + 2bc^2e - c^3e\\ + 2a^2de - abde - 3b^2de - acde - bcde\\ + 2c^2de + 2ad^2e + 2bd^2e - 3cd^2e - d^3e\\ + a^2e^2 + 2abe^2 + b^2e^2 + 2ace^2 - 3bce^2\\ + c^2e^2 - 3ade^2 + 2bde^2 + 2cde^2 + d^2e^2\\ - ae^3 - be^3 - ce^3 - de^3 + e^4)\\(a + b + c + d + e) \end{align} $$Clearly, once again, the sum of the digits \(a+b+c+d+e\) divides the determinant.

If we consider the permanent of the circulant matrix and not the determinant, then out of the first one million numbers there are 106343 numbers, roughly 10%, whose sum of digits divides the permanent (permalink).

Tuesday, 30 March 2021

Analysis of an Interesting Graph

In my last post I evaluated the integral of the function:$$y= \frac{\sin(\ln x)}{\ln x}$$ between 0 and 1 and arrived at a value of \( \frac{\pi}{4} \) using Feyman's technique. In this post, I want to look at the function more closely in terms of its turning points and intercepts on the \(x\) axis. Figure 1 shows the behaviour of the graph in the region between 0 and 1.



Figure 1: created using GeoGebra

Clearly there is a small negative area that will reduce the largely positive area slightly but the figure of \( \frac{\pi}{4} \approx \) 0.785398163397448 looks pretty right. Clearly, the graph cuts the \(x\) axis around 0.4 but what about further out along the \(x\) axis? Figure 2 shows the graph of the function in the range from 0 to 100:


Figure 2: created using Wolfram Alpha

Figure 3 shows a slightly different view. 


Figure 3: created using Wolfram Alpha

Let's look at the graph in the range from 0 to 1000. Figure 4 shows this:

Figure 4: created using Wolfram Alpha

To see what's going on with these intercepts on the \(x\) axis we just need to set the function equal to zero. Let's do this and solve the resulting equation:$$
\begin{align} \frac{\sin(\ln x)}{\ln x}&=0\\
\implies \sin(\ln x)&=0 \text{ provided that } \ln x \neq 0\\
\implies \ln x &=n\pi \text{ where }n \in \mathbb{Z} \text{ and } n \neq 0\\
\therefore x&=e^{\ \pi \ n} \text{ with } n \neq 0
\end{align}$$Thus we begin to see what's going on:
  • The intercept in Figure 1 corresponds to \(n=-1\) and \(e^{-\pi} \approx 0.04 \)
  • The intercept in Figure 2 corresponds to \(n=1\) and \(e^{\pi} \approx 23.14 \)
  • The intercept in Figure 4 corresponds to \(n=2\) and \(e^{2\pi} \approx 535.49 \)
Clearly as \(n\) grows larger, the values of \(e^{\ \pi \ n}\) become very large and the intercepts more and more spread out along the number line. Similarly as -\(n\) grows larger negatively, the values of \(e^{\ -\pi \ n}\) become very small and the intercepts closer and closer together.

What about the turning points of the graph? To explore this we need to find the first derivative of the function. We find:$$
\begin{align}
\frac{d}{dx} \left (\frac{\sin(\ln x)}{\ln x} \right )&=\frac{\ln x \cos(\ln x)-\sin(\ln x)}{x \ln^2 x}\\
\implies \ln x \cos(\ln x)-\sin(\ln x)&=0 \text{ provided } x \ln^2 x \neq 0
\end{align}$$A partial solution to this is offered by Wolfram Alpha but the computation times out so only three solutions are shown. See Figure 5:


Figure 5: from Wolfram Alpha

From these results we can see the local minimum of \(x \approx 0.01\) in Figure 1 and the local maximum of x=1 in Figure 3. Some further results can be obtained from Wolfram Alpha simply by asking for turning points. These are shown in Figure 6.


Figure 6: from Wolfram Alpha

These results are most interesting because we can see a maximum value of around 0.049 when \(x=0\) but a minimum value of around -0.058 when \(x=0\)! Clearly, the function should be undefined at \(x=0\) even though a limit of 0 seems to exist. The issue of the limit is an interesting one which I may take up in a subsequent post but for the time being that's probably enough for the graph.

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

Sunday, 19 June 2016

Partitions

As I've been reading "The Man Who Knew Infinity", the topic of partitions came up and I felt impelled to delve a little further into the topic. Wikipedia defines a partition as follows:
In number theory and combinatorics, a partition of a positive integer \(n\), also called an integer partition, is a way of writing \(n\) as a sum of positive integers. Two sums that differ only in the order of their summands are considered the same partition. (If order matters, the sum becomes a composition.) For example, 4 can be partitioned in five distinct ways: 
4 
3 + 1 
2 + 2 
2 + 1 + 1 
1 + 1 + 1 + 1 
The order-dependent composition 1 + 3 is the same partition as 3 + 1, while the two distinct compositions 1 + 2 + 1 and 1 + 1 + 2 represent the same partition 2 + 1 + 1. 
A summand in a partition is also called a part. The number of partitions of \(n\) is given by the partition function \(p(n) \). So \(p(4)\) = 5. The notation \( \lambda \vdash n \) means that \( \lambda \) is a partition of \( n \). 
Partitions can be graphically visualised with Young diagrams or Ferrers diagrams.
Wolfram Alpha can be used to generate the number of partitions for a given number. An example of the number 5 is shown below, with visualisation using Ferrers diagrams:

 

The OEIS sequence for the number of partitions of the various numbers is A000041 and begins as follows:
1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604, 6842, 8349, 10143, 12310, 14883, 17977, 21637, 26015, 31185, 37338, 44583, 53174, 63261, 75175, 89134, 105558, 124754, 147273, 173525
In terms of my numbered days, the last partition number was 21637 and the next will be 26015. This is only the briefest of introductions to the topic and I've not even mentioned the partition-generating function. I'll add it here just for completeness:$$\sum_{n=0}^{\infty} p(n) \, x^n=\prod_{k=1}^{\infty} \left ( \frac{1}{1-x^k} \right )$$

on Thursday April 8th 2021