Showing posts with label euler. Show all posts
Showing posts with label euler. Show all posts

Friday, 7 August 2026

Sums of Digits

The number associated with my diurnal age today, 28248, has the property that its digits raised to the fourth power are equal to its totient.$$ \begin{align} 2^4 + 8^4 + 2^4 + 4^4 + 8^4 &= 8480 \\ \phi(28248) &= 8480 \end{align}$$This qualifies it for membership in OEIS A269669:


A269669
numbers whose Euler totient function is equal to the sum of some fixed power of their digits.

The numbers in this sequence are few and far between, with 28248 being the last in the range up to 40000. The initial members are 1, 2, 20, 40, 228, 352, 712, 813, 835, 2079, 4020, 28248. Take 20 as another example:$$ \begin{align} 2^3 + 0^3 &= 8 \\ \phi(20) &= 8 \end{align}$$As part of my daily number analysis, I consider:

  • the sum of the digits of a number
  • the sum of the digits squared of a number
  • the sum of the digits cubed of a number
If all three sums are prime, then I make a note of it. I consider higher powers of the digits in the context of narcissistic numbers where a narcissistic number is defined as a \(k\)-digit nonnegative number equal to the sum of the \(k\)-th powers of its digits. An example is of such a number is 9474 where:$$9474=9^4+4^4+7^4+4^4$$D-powerful numbers are similar but are defined as integers that can be expressed as a sum of positive powers of their digits. An example is 994 where:$$994=9^3+9^1+4^4$$OEIS A269669 relates such sums to a number's totient which I hadn't thought of doing before. This idea can be extended to other number properties of a number and I've included a list of such properties as output from my daily number analysis. The example below is for 28248 where the equality between its totient and the sum of its digits raised to the fourth power can be clearly seen.

  Daily Number                      28248
  Sum of Divisors                   77760
  Sum of Proper Divisors            49512
  Totient                           8480
  Sum of DISTINCT prime factors     123
  Sum of Unitary Divisors           46656
  Sum of Digits                     24
  Sum of Digits Squared             152
  Sum of Digits Cubed               1104
  Sum of Digits to Fourth Power     8480
  Sum of Digits to Fifth Power      66624
  Product of Digits                 1024
  Gray Code                         22900
  Binary Complement                 4519
  Arithmetic Derivative             54620
  Determinant of Circulant Matrix   11904

If we search for numbers whose arithmetic derivative is equal to the sum of some fixed power of their digits, we don't find many. In the case of \(n=2\), we only have 581, 8549 and 16999 with sums of digits squared and arithmetic derivatives of 90,186 and 280 respectively in the range up to 40000. For \(n=3\) we only have 142, 6127 and 12643 with sums of digits cubed and arithmetic derivatives of 73, 568 and 316 respectively. For higher powers, nothing in the range up to 40000. Here is the permalink.$$ \begin{align} 581 &\rightarrow 5^2+8^2+1^2 = 90 \text{ = arithmetic derivative of 581} \\ 8549 &\rightarrow 8^2+5^2+4^2+9^2 = 186 \text{ = arithmetic derivative of 8549} \\ 16999 &\rightarrow 1^2+6^2+9^2+9^2+9^2 = 280 \text{ = arithmetic derivative of 16999} \\ 142 &\rightarrow 1^2+4^3+2^3 = 73 \text{ = arithmetic derivative of 142} \\ 6127 &\rightarrow 6^3+1^3+2^3+7^3 = 568 \text{ = arithmetic derivative of 6127} \\ 12643 &\rightarrow 1^3+2^3+6^3+4^3+3^3 =316 \text{ = arithmetic derivative of 12643} \end{align}$$

Friday, 31 July 2026

Euler's Formula


Graphic created using Gemini

Courtesy of Gemini:

Often cited as the most beautiful theorem in mathematics, Euler’s identity (\(e^{i\pi} + 1 = 0\)) achieves its fame by elegantly linking the most fundamental constants and operations in a single, concise equation.

Here is the history behind its discovery and the mathematical proof of why it works.

The History Behind the Identity

The equation is a specific case of Euler’s formula, which states that for any real number \(x\):

\[e^{ix} = \cos(x) + i\sin(x)\]

While the identity bears the name of the brilliant Swiss mathematician Leonhard Euler, the groundwork was laid slightly earlier. In 1714, the English mathematician Roger Cotes discovered a precursor to this relationship, expressing it in terms of natural logarithms: \(\ln(\cos x + i\sin x) = ix\).

However, it was Euler who, in 1748, formalized the mathematics into the modern exponential form we use today. He published it in his foundational text Introductio in analysin infinitorum (Introduction to the Analysis of the Infinite).

The identity is celebrated because it connects five foundational mathematical constants from entirely different disciplines:

  • \(0\): The additive identity (the foundation of arithmetic).
  • \(1\): The multiplicative identity (the foundation of counting).
  • \(\pi\): The fundamental constant of geometry (the ratio of a circle's circumference to its diameter).
  • \(e\): The fundamental constant of growth and continuous change (the base of natural logarithms).
  • \(i\): The imaginary unit (\(\sqrt{-1}\)), which unlocks complex algebra.

It also seamlessly utilizes the three most basic mathematical operations: addition, multiplication, and exponentiation.


Why the Equation Holds True

To prove why this works, we must look to Taylor series (specifically, Maclaurin series expansions). A Maclaurin series allows us to express complex functions as an infinite sum of polynomial terms.

The series expansion for the exponential function \(e^x\) is:

\[e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} + \dots\]

If we substitute \(x = i\theta\) into this series, we get:

\[e^{i\theta} = 1 + (i\theta) + \frac{(i\theta)^2}{2!} + \frac{(i\theta)^3}{3!} + \frac{(i\theta)^4}{4!} + \frac{(i\theta)^5}{5!} + \dots\]

Next, we evaluate the powers of \(i\). By definition, \(i = \sqrt{-1}\), which creates a repeating pattern:

  • \(i^1 = i\)
  • \(i^2 = -1\)
  • \(i^3 = -i\)
  • \(i^4 = 1\)
  • \(i^5 = i\)

Substituting these evaluated powers back into our series gives:

\[e^{i\theta} = 1 + i\theta - \frac{\theta^2}{2!} - \frac{i\theta^3}{3!} + \frac{\theta^4}{4!} + \frac{i\theta^5}{5!} - \dots\]

Now, we group the real terms (those without an \(i\)) and the imaginary terms (those multiplied by \(i\)) together:

\[e^{i\theta} = \left( 1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \dots \right) + i\left( \theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \dots \right)\]

This is where Euler's brilliant connection becomes visible. These two grouped polynomial expansions perfectly match the standard Maclaurin series expansions for the trigonometric functions cosine and sine:

\[\cos(\theta) = 1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \dots\]

\[\sin(\theta) = \theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \dots\]

By substituting \(\cos(\theta)\) and \(\sin(\theta)\) back into our grouped equation, we arrive at Euler's formula:

\[e^{i\theta} = \cos(\theta) + i\sin(\theta)\]

Reaching the Final Identity

To get Euler's Identity, we evaluate the formula at \(\theta = \pi\) radians (which corresponds to \(180\) degrees on the unit circle):

\[e^{i\pi} = \cos(\pi) + i\sin(\pi)\]

Looking at a standard trigonometric unit circle, we know that:

  • \(\cos(\pi) = -1\)
  • \(\sin(\pi) = 0\)

Substituting these values in:

\[e^{i\pi} = -1 + 0i\]

\[e^{i\pi} = -1\]

By simply adding \(1\) to both sides, we arrive at the final state of the identity, linking the five constants perfectly together:

\[e^{i\pi} + 1 = 0\]

Here is a Gemini link to information about the mathematicians Taylor and MacLaurin.

Tuesday, 12 May 2026

Heegner Numbers

My diurnal age today is \( \textbf{28163} \), a prime number, as is \( \textbf{163} \), the number formed by its last three digits. The latter number is quite famous in higher mathematics but I always forget why so I got Gemini to remind me.

The special quality of 163 that places it firmly in the realm of higher mathematics is that it is the largest of the nine Heegner numbers.

In algebraic number theory, a Heegner number is a square-free positive integer $d$ such that the imaginary quadratic field $\mathbb{Q}(\sqrt{-d})$ has class number $1$. Equivalently, this means the ring of integers of this field exhibits unique factorization. The complete set of Heegner numbers (cataloged as OEIS sequence A003173) is $1, 2, 3, 7, 11, 19, 43, 67$, and $163$.

The fact that $163$ ends this sequence leads to two profound and famous mathematical consequences: Ramanujan's constant and the deep structure behind Euler's prime-generating polynomial.

Ramanujan's Constant and Almost-Integers

Because 163 is the largest Heegner number, it produces an astonishing "almost-integer" when placed in the exponential function $e^{\pi \sqrt{d}}$. Specifically:

$$e^{\pi \sqrt{163}} \approx 262537412640768743.99999999999925007...$$

This is widely known as Ramanujan's constant. The reason this number is so staggeringly close to an integer is not a coincidence, but a direct result of the properties of the modular $j$-function.

For any Heegner number $d$, the $j$-invariant of the associated elliptic curve is an exact integer. For $d=163$, the $j$-invariant is exactly $-(640320)^3$.

The Fourier series expansion of the $j$-function in terms of $q = e^{2\pi i \tau}$ is:

$$j(\tau) = \frac{1}{q} + 744 + 196884q + 21493760q^2 + \dots$$

When we evaluate this at $\tau = \frac{1 + \sqrt{-163}}{2}$, $q$ becomes $-e^{-\pi \sqrt{163}}$. Because $163$ is very large, the higher-order terms ($196884q$, etc.) become infinitesimally small. By equating the exact integer $j$-invariant with the first two terms of the expansion, we get:

$$-(640320)^3 \approx -e^{\pi \sqrt{163}} + 744$$

Rearranging this yields:

$$e^{\pi \sqrt{163}} \approx (640320)^3 + 744 = 262537412640768744$$

Euler's Prime-Generating Polynomial

In 1772, Leonhard Euler published the famous quadratic polynomial $n^2 + n + 41$, which yields prime numbers for every integer $n$ from $0$ to $39$.

The remarkable prime-generating efficiency of this polynomial is directly tied to the field $\mathbb{Q}(\sqrt{-163})$. The discriminant of the polynomial $x^2 + x + 41$ is $1^2 - 4(1)(41) = -163$.

Rabinowitsch's theorem states that for $d \equiv 3 \pmod 4$, the polynomial $n^2 + n + \frac{d+1}{4}$ will output primes for all integers $n = 0, 1, \dots, \frac{d-3}{4}$ if and only if $d$ is a Heegner number. Because $163$ is the largest Heegner number, $\frac{163+1}{4} = 41$, making Euler's polynomial the absolute optimal case for this specific phenomenon. There is no other polynomial of this form that will generate a longer string of consecutive primes.


Photo of Kurt Heegner, this photo was taken at the
terrace of his mother's home in Berlin in the 1930s

I only partially understand the mathematics involved. The story behind Heegner, after whom the numbers are named, is as follows: 

The name attached to these numbers belongs to Kurt Heegner (1893–1965), and his story is one of the most famous and somewhat tragic examples of an "outsider" solving a major mathematical problem but dying before receiving recognition.

Here is the history of the man and why the numbers bear his name:

A Private Scholar, Not an Academic

Kurt Heegner was a German mathematician, physicist, and radio engineer. He was born and lived in Berlin for most of his life. Unlike the vast majority of names attached to profound mathematical discoveries, Heegner was not a professional academic. He held no university chair and spent much of his career working in radio engineering and patenting electronic circuits. Mathematics was a pursuit he undertook independently as a private scholar.

Gauss's Class Number Problem

The origin of the Heegner numbers dates back to 1801, when Carl Friedrich Gauss published his foundational text Disquisitiones Arithmeticae. Gauss conjectured that there were exactly nine imaginary quadratic fields with class number 1 (which correspond to the nine numbers $1, 2, 3, 7, 11, 19, 43, 67$, and $163$). For a century and a half, proving that there was no tenth number remained one of the outstanding unsolved problems in number theory.

The 1952 Proof and Rejection

In 1952, Heegner published a paper in a reputable mathematical journal claiming to have finally proven Gauss's conjecture. Heegner's approach was highly unorthodox for the time; he used complex modular functions (specifically building on the earlier work of Heinrich Weber) and Diophantine equations.

Unfortunately, the mathematical establishment completely dismissed his work. Reviewers found his paper dense, unconventional, and difficult to follow. It was widely concluded that his proof contained a fatal gap and was incomplete. Because Heegner was an unknown amateur without academic credentials to vouch for him, the mathematical community effectively ignored his publication, and the problem was still considered unsolved. Heegner died in 1965 without ever seeing his work accepted.

Posthumous Vindication

The story changed dramatically in 1966 and 1967. Two mathematicians, Alan Baker and Harold Stark, independently published universally accepted proofs of Gauss's conjecture using entirely different methods. Stark's proof, in particular, was celebrated as a major breakthrough.

However, in 1968, the British mathematician Bryan Birch (of the Birch and Swinnerton-Dyer conjecture) and Harold Stark himself decided to look back at Heegner's dismissed 1952 paper. Upon careful re-examination, they realized that Heegner’s proof was actually completely correct.

The supposed "gap" in Heegner's logic was not a flaw; he had simply omitted the details of a specific theorem from Weber's work, assuming the reader would know it. Once that theorem was explicitly applied, Heegner's proof was airtight. Stark and Birch brought this to the attention of the mathematical community, establishing that Heegner had successfully solved the problem 15 years before anyone else.

Legacy

To honor his undisputed priority and to rectify the community's failure to recognize a brilliant piece of mathematics during his lifetime, the nine numbers of Gauss's conjecture were formally named Heegner numbers. Furthermore, the points he used on elliptic curves to construct his proof are now known in modern arithmetic geometry as Heegner points, which remain a highly active and critical area of research in number theory today.

Wednesday, 21 January 2026

An Interesting Limit

Here is a report generated by Gemini Pro based on the content of this video. I found the video moved a little too quickly at times and the author read out every mathematical expression symbol by symbol which wasn't really necessary and it didn't aid comprehension. It's useful to be able to take the content of the video and put into a report that can be read at your leisure. If you want to tweak the LaTeX code, you can do so easily and I've done that below for a few of expressions.

The Limit of the nth Root: An Exploration of Euler's Sequence

At first glance, the limit of the sequence involving factorials and powers can seem intuitive, but as with many problems in analysis, the "obvious" answer can be misleading. This report dismantles the problem of finding the limit of the nth root of n factorial divided by n to the power of n. Following the path likely walked by Leonhard Euler, we move from discrete sequences to continuous calculus to find a beautiful truth connecting factorials, limits, and Euler’s number, e.

1. The Sequence and Intuition

We begin by defining our sequence \( a_n \):

$$ a_n = \frac{n!}{n^n} $$

Intuitively, the denominator \( n^n \) grows much faster than the numerator \( n! \), suggesting that the terms drop toward zero. To prove this rigorously, we employ the Ratio Test. We investigate the ratio of consecutive terms:

$$ \frac{a_{n+1}}{a_n} = \frac{(n+1)!}{(n+1)^{n+1}} \cdot \frac{n^n}{n!} $$

Simplifying the factorials (\( (n+1)! = (n+1)n! \)) and regrouping terms gives:

$$ \frac{a_{n+1}}{a_n} = \frac{(n+1) \cdot n^n}{(n+1)^{n+1}} = \frac{n^n}{(n+1)^n} = \left( \frac{n}{n+1} \right)^n $$

This expression can be rewritten to reveal a fundamental definition of Euler's number:

$$ \lim_{n \to \infty} \frac{a_{n+1}}{a_n} = \lim_{n \to \infty} \frac{1}{\left( \frac{n+1}{n} \right)^n} = \lim_{n \to \infty} \frac{1}{\left( 1 + \frac{1}{n} \right)^n} = \frac{1}{e} $$

Since \( \dfrac{1}{e} \approx 0.3679 \) is strictly less than 1, the Ratio Test confirms that the sequence converges to 0.

2. The Main Problem: The nth Root

Establishing that the base sequence goes to 0 is just the preamble. The true challenge is finding the limit of the nth root of this sequence:

$$ L = \lim_{n \to \infty} \sqrt[n]{a_n} = \lim_{n \to \infty} \left( \frac{n!}{n^n} \right)^{\frac{1}{n}} $$

Since the base approaches 0 and the exponent \( \frac{1}{n} \) also approaches 0, we are facing the indeterminate form \( 0^0 \). To resolve this, we use the natural logarithm to transform the product into a sum, bridging the gap between discrete algebra and integral calculus.

3. From Logarithms to Riemann Sums

Let \( y = \sqrt[ \uproot{4} n]{a_n} \). Taking the natural log of the limit allows us to work with sums:

$$ \ln(L) = \lim_{n \to \infty} \ln \left( \left( \frac{n!}{n^n} \right)^{\frac{1}{n}} \right) = \lim_{n \to \infty} \frac{1}{n} \ln \left( \frac{n!}{n^n} \right) $$

Using logarithm rules, we expand the term inside:

$$ \ln \left( \frac{n!}{n^n} \right) = \ln(n!) - \ln(n^n) = \sum_{k=1}^{n} \ln(k) - n \ln(n) $$

We can cleverly rewrite \( n \ln(n) \) as a sum of \( n \) identical terms: \( \displaystyle \sum_{k=1}^{n} \ln(n) \). Substituting this back into our limit equation gives:

$$ \ln(L) = \lim_{n \to \infty} \frac{1}{n} \left( \sum_{k=1}^{n} \ln(k) - \sum_{k=1}^{n} \ln(n) \right) = \lim_{n \to \infty} \frac{1}{n} \sum_{k=1}^{n} \left( \ln(k) - \ln(n) \right) $$

Combining the logs, we arrive at a recognizable form:

$$ \ln(L) = \lim_{n \to \infty} \frac{1}{n} \sum_{k=1}^{n} \ln \left( \frac{k}{n} \right) $$

This structure—a sum of function values multiplied by a small width \( \frac{1}{n} \) is precisely the definition of a Riemann Sum on the interval \([0, 1]\). As \( n \to \infty \), the sum converges to a definite integral:


$$ \ln(L) = \int_{0}^{1} \ln(x) \, dx $$

4. Evaluating the Integral

We now evaluate the improper integral of \( \ln(x) \) from 0 to 1. Using integration by parts (where \( u = \ln(x) \) and \( dv = dx \)), we get:

$$ \int \ln(x) \, dx = x \ln(x) - x $$

We evaluate the definite integral by taking the limit as the lower bound approaches 0:

$$ \Bigl[ x \ln(x) - x \Bigr]_0^1 = (1 \ln(1) - 1) - \lim_{a \to 0^+} (a \ln(a) - a) $$

We know \( \ln(1) = 0 \), so the first term is \( -1 \). For the limit \( \lim_{a \to 0^+} a \ln(a) \), we use L'Hôpital's rule, which shows that this term vanishes to 0. Thus:

$$ \ln(L) = -1 - 0 = -1 $$

Conclusion

We have found that the natural logarithm of the limit is \( -1 \). To find the original limit \( L \), we simply exponentiate both sides:

$$ L = \lim_{n \to \infty} \left( \frac{n!}{n^n} \right)^{\frac{1}{n}}=e^{-1} = \frac{1}{e} $$

We have proven that while the sequence \( \dfrac{n!}{n^n} \) collapses to zero, its geometric mean—the nth root—stabilizes at exactly 1 over e. This problem serves as an elegant bridge connecting basic sequence properties, the definition of e, and the power of integral calculus.

Sunday, 29 September 2024

Properties of Concatenated Numbers

Let's split a number in two parts and then consider the relationship that these two parts bear to the number of which both are a part. Now I've done this before as described in a post titled Energetic Numbers. In THAT post, I looked at numbers that belong to OEIS  A055480:


 A055480

Energetic numbers: numbers that can be broken into two or more substrings and expressed as a sum of (possibly different) positive powers of those substrings.

In THIS post I'll be looking at two different types of relationships. Let's consider 27573 and break it into two parts: 275 and 73. It turns out that my diurnal age today (27573) has an interesting property and it involves the totient function, commonly referred to as Euler's phi function or simply the phi function. We find that:$$ \begin{align}  \phi(27573) &= 1440 \\ \phi(275) \times \phi(73) &= 200 \times 72\\ &=1440 \end{align} $$Numbers like this belong to OEIS A147619 :


 A147619             Numbers \(n\)  = \(a \,| \, b\) such that \( \phi(n) = \phi(a) \times \phi(b) \)
                                where the symbol | represents concatenation


The initial members of this sequence are:

78, 780, 897, 918, 1179, 1365, 1776, 2574, 2598, 2967, 3168, 3762, 4758, 5775, 5796, 7800, 7875, 7917, 8217, 8970, 9180, 9576, 11790, 13650, 13662, 13875, 13896, 14391, 17760, 18564, 18858, 19812, 20097, 25740, 25935, 25974, 25980, 27573, 28776, 28779, 29670, 31680, 33165, 35919, 37620

Let's look at the breakdown for the numbers between 27573 and 37620:
  • 275 | 73  -->  27573

  •  287 | 76  -->  28776

  •  287 |  79  -->  28779

  •  29 | 670  -->   29670

  •  31 | 680  -->   31680

  •  331 | 65  -->   33165

  •  35 | 919  -->   35919

  •  37 | 620  -->   37620

A similar thing can be done with the sigma function that tallies the sum of the divisors of a number. Once again we break the number into two parts and then use the sigma function to connect those two parts to the whole. There is no OEIS function this time around but the property of the numbers being considered is as follows:


 Numbers \(n\)  = \(a \,| \, b\) such that \( \sigma(n) = \sigma(a) \times \sigma(b) \)
where the symbol | represent concatenation


The 78 numbers satisfying this condition between 27000 and 40000 are (permalink):

27175, 27298, 27418, 27445, 27500, 28018, 28195, 28750, 28798, 28978, 29038, 29058, 29098, 29278, 29395, 29398, 29500, 29875, 29875, 29950, 29950, 29980, 30498, 30775, 30788, 30989, 31750, 31795, 31918, 32595, 33175, 33238, 33298, 33725, 34189, 34555, 34557, 34795, 34975, 35338, 35395, 35578, 35585, 35670, 35818, 35975, 36178, 36238, 36350, 36398, 36426, 36775, 37138, 37241, 37678, 37750, 37798, 38247, 38370, 38518, 38570, 38638, 38750, 38826, 38856, 38877, 38940, 38975, 39118, 39425, 39478, 39500, 39754, 39805, 39898, 39976, 39980, 39992

Table 1 shows the breakdown for numbers between 27000 and 30000:


Table 1

Let's look at the first number 27175 where we break the number into 271 and 75 and we have:$$ \begin{align} \sigma(27175) &= 33728\\ \sigma(271) \times \sigma(75) &= 272 \times 124\\ &= 33728 \end{align}$$There are other possible concatenations involving more than two parts or other functions and properties of numbers so this post is merely a sample.

Monday, 23 September 2024

More Numbers Within Numbers


In 
December of 2022, I made a post titled Numbers Within Numbers and so for this post I've made the title More Numbers Within Numbers but the types of numbers considered in the former post are quite different to the ones I'll be considering in this post. The idea for this post came from a peculiarity in the number associated with my diurnal age today: 27567.

What I mean by a number within a number in this present context is simply a substring of the number viewed as a string. Here the substring being considered is "27" that is contained within the larger string "27567". Thus we see that:$$ {\Large \textbf{27} 567}$$Now let's consider the sum of digits of the number:$${\Large \textbf{27} 567 \rightarrow  2 + 7 + 5 + 6+7= \textbf{27}}$$Let's move on to the factorisation where we have:$${\Large \textbf{27} 567= \textbf{27} \times 1021}$$Now what about the totient? We find that 27567 has a totient of 18360 and$$ {\Large 18360 = 5 \times 8 \times 17 \times \textbf{27}} $$Lastly, let's find the absolute value of the determinant of the circulant matrix of 27567. It turns out to be 6777 and$$  {\Large 6777  = \textbf{27} \times 251}  $$Thus in the case of 27567, the number within a number (27) turns up:

  • in the digits of the number
  • as the sum of the digits of the number
  • in the factors of the number
  • in the factors of the totient
  • in the factors of the determinant of the circulant matrix
It can be noted that 27567 is a Harshad number since it is a multiple of its sum of digits (27), and also a Moran number because the ratio is a prime number: 1021 = 27567 / (2 + 7 + 5 + 6 + 7).

The natural question to ask then is how many numbers in the range up to 40000 have this property? It turns out that there are only 18 such numbers with details as shown in Table 1.


Table 1: permalink

So what about other numbers? Let's start with a substring "1". There are five numbers satisfying the previous criteria in the range up to 40000. See Table 2.


Table 2: permalink

For substring "2", there are four numbers satisfying the criteria. See Table 3.


Table 3: permalink

For the substring "3", there are no numbers that meet the criteria. For the substring "4", there are appropriately four numbers that satisfy. See Table 4.


Table 4: permalink

For the substring "5", there are three numbers that meet the criteria. See Table 5.


Table 5: permalink

For substrings "6" and "7", no numbers qualify but for the substring "8" there are three numbers that do. See Table 6.


Table 6: permalink

There are no numbers that satisfy for "9" but there are 23 numbers that satisfy for "10". See Table 7.


Table 7: permalink

For "11", no numbers that satisfy but for "12" there are 39 numbers that satisfy. See Table 8.


Table 8: permalink

For "13", there are two numbers that satisfy. See Table 9.


Table 9: permalink

For "14", there are three numbers that satisfy. See Table 10.


Table 10: permalink

For "15", there are 26 numbers that satisfy. See Table 11.


Table 11: permalink

For "16", there are 14 numbers that satisfy. See Table 12.


Table 12: permalink

For "17", there is only one number. See Table 13.


Table 13: permalink

For "18", there is a grand total of 69 numbers that qualify. See Table 14.


Table 14: permalink

For "19", there are no numbers that qualify but for "20" there are four. See Table 15.


Table 15: permalink

For "21", there are three numbers that qualify. See Table 16.


Table 16: permalink

For "22", there are two numbers that satisfy. See Table 17.


Table 17: permalink

For "23", there is only one number that satisfies. See Table 18.


Table 18: permalink

For "24", there are nine numbers that satisfy. See Table 19.


Table 19: permalink

For "25", there are four numbers that satisfy. See Table 20.


Table 20: permalink

For "26", there are no numbers that qualify and we've already dealt with "27". For "28", there is only one number that satisfies. See Table 21.


Table 21: permalink

That's it for particles in the range up to 40,000 as the SOD criterion makes it difficult  for the digit sum to reach these higher particles. Just to illustrate with an example. Take the particle "29". If we extend the range to one million, then instead of the zero for the range up to 40,000, we have nine numbers that satisfy the criteria. See Table 21.


Table 21: permalink

So, an interesting exercise but purely confined to the realm of recreational Mathematics. There no real reason to conflate the digit sum of a number with its factors as well as its totient and the determinant of its circulant matrix. 

Tuesday, 27 February 2024

Idoneal Numbers

Euler's numeri idonei or idoneal numbers (suitable or convenient numbers) were included in four papers that Euler presented to the Petersberg Academy in 1778. They are:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 21, 22, 24, 25, 28, 30, 33, 37, 40, 42, 45, 48, 57, 58, 60, 70, 72, 78, 85, 88, 93, 102, 105, 112, 120, 130, 133, 165, 168, 177, 190, 210, 232, 240, 253, 273, 280, 312, 330, 345, 357, 385, 408, 462, 520, 760, 840, 1320, 1365, 1848

The property that these numbers share is that they cannot be represented in the form \( ab+ac+bc \) with \(0 < a < b < c\). While 1848 is the largest known number, this source states that:

S. Chowla proved (in 1934) that the number of numeri idonei is finite, and it is known that there can be at most ONE more square-free numerus idoneus beyond those found by Euler.  Whether such another number exists is still an open question.

However, another source states that 1848 is the largest number if the Riemann Hypothesis hold true otherwise what's said above will hold.

I came across the reference to these numbers when investigating the number associated with my diurnal age today, namely 27358. It is a member of OEIS


  A094377

Greatest number having exactly n representations as \(ab+ac+bc \) with \(0 < a < b < c\).



Up to 40,000, the initial members of this sequence are:

1848, 193, 1012, 862, 3040, 2062, 4048, 3217, 7392, 4162, 7837, 8002, 12397, 13297, 14722, 16417, 21253, 21058, 30493, 27358, 34357, 34318

Here we see 1848 appearing as the greatest number for the case of \(n=0\), in other words it cannot be represented in this way. On the other hand, 193 is the greatest number that can be represented in only one way, namely:$$193=4 \times 7 + 4 \times 15 + 7 \times 15\\ \text{where } a=4, b=7 \text{ and } c=15$$27358 corresponds to the case of \(n=19\), in other words this number can be represented in 19 different ways in the form \(ab+ac+bc \). Here are 18 of them with one missing that I haven't been able to find.
  • 5 - 134 - 192
  • 14 - 32 - 585
  • 19 - 34 - 504
  • 23 - 56 - 330
  • 26 - 81 - 236
  • 26 - 105 - 188
  • 29 - 134 - 144
  • 30 - 41 - 368
  • 30 - 112 - 169
  • 34 - 72 - 235
  • 35 - 66 - 248
  • 44 - 53 - 258
  • 44 - 107 - 150
  • 56 - 102 - 137
  • 57 - 70 - 184
  • 66 - 91 - 136
  • 71 - 108 - 110
  • 9 - 14 - 1184
There's a lot more to this topic but let's return to the idoneal numbers and find out why they are "convenient". Well, they are convenient because they were used historically to help find large primes using the formula:$$x^2+n\, y^2\\ \text{ where } n \text{ is a convenient number}$$For example, Euler was able to find the prime:$$18,518,809=197+1848 \times 100$$where as can be seen the largest convenient number makes its appearance. If we replace 197 with other primes, we find that in the prime range up to 600, 46.3% of the resultant numbers are prime (permalink). It would be interesting to see how this figure compares to others using different convenient numbers and/or different values of \(x\) and \(y\).

This is a fairly deep topic and I won't go further into it here but it's clear that the idoneal numbers are a small but fascinating group.

Thursday, 2 March 2023

Hamiltonian Paths Revisited

On the 6th February 2021, I posted about Hamiltonian Paths and Knight's Tours. That was over two years ago now but today I have the opportunity to revisit the topic of Hamiltonian paths because the number associated with my diurnal age, 26996, is a member of OEIS A003778:


 A003778

Number of Hamiltonian paths in \(P_5 \times P_n \).               



In the case of 26996, \(n=6\).  Figure 1 shows such a \(5 \times 6 \) grid.


Figure 1

A Hamiltonian path is one that passes through every vertex exactly once. One example of such a path is shown in Figure 2. Note that in this 2D grid connections between vertices or nodes are made up-down and left-right but not diagonally.


Figure 2

In the case of a \(5 \times 6\) grid, there are 26996 such paths that can be drawn. The number of paths increases rapidly as the number of points increases. Here are the initial values:
  • \(5 \times 1 \rightarrow 1\)
  • \(5 \times 2 \rightarrow 22\)
  • \(5 \times 3 \rightarrow 132\)
  • \(5 \times 4 \rightarrow 1006\)
  • \(5 \times 5 \rightarrow  4324\)
  • \(5 \times 6 \rightarrow 26996\)
  • \(5 \times 7 \rightarrow  109722\)
  • \(5 \times 8 \rightarrow 602804\)
  • \(5 \times 9 \rightarrow 2434670\) 
  • \(5 \times 10 \rightarrow 12287118\)
Here is a permalink to some Python code that will plot a Hamiltonian path through a grid of specified size. Figure 3 shows the output in the case of a \(5 \times 6\) grid:

[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (1, 5), (1, 4), (1, 3), (1, 2), (1, 1), (1, 0), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (3, 5), (3, 4), (3, 3), (3, 2), (3, 1), (3, 0), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5)]


Figure 3

This YouTube video does a good job of explaining in simple terms the difference between a Hamiltonian path and an Euler path. For the latter, the path must traverse every edge exactly once whereas in the former it is every vertex that must be traversed.

There is a 36-term linear recurrence mentioned in the OEIS A003778 comments which is the closest thing to a formula that seems to be available for calculating the number of possible paths. Hamiltonian paths and cycles are intimately connected with the travelling salesman problem as this site explains:
Travelling Salesman Problem (TSP): 

Given a set of cities and the distance between every pair of cities, the problem is to find the shortest possible route that visits every city exactly once and returns to the starting point. Note the difference between Hamiltonian Cycle and TSP. The Hamiltonian cycle problem is to find if there exists a tour that visits every city exactly once. Here we know that Hamiltonian Tour exists (because the graph is complete) and in fact, many such tours exist, the problem is to find a minimum weight Hamiltonian Cycle. 

Figure 4

For example, consider the graph shown in the Figure 4 on the right side. A TSP tour in the graph is 1-2-4-3-1. The cost of the tour is 10+25+30+15 which is 80. The problem is a famous NP-hard problem. There is no polynomial-time know solution for this problem. 

The site goes to provide programming solutions to this particular instance of the TSP but the Python3 solution doesn't work. However, the minimum cost Hamiltonian tour is  80 and 1-2-4-3-1 is one solution. This YouTube video offers a useful tutorial on how to draw graphs, such as the one shown in Figure 3, using SageMath.

I discovered an interesting site called Graph Online that allows you to create graphs and find Hamiltonian and Eulerian paths and cycles as well as Adjacency and Incidence Matrices. Figure 5 shows the Hamiltonian path that it came up with for the graph that I drew. No Hamiltonian cycle is possible.

Figure 5

Figure 6 shows a Eulerian path. No Eulerian cycle is possible. The site will display and analyse many other types of graphs. I've just focused on two here.


Figure 6