Sunday 29 March 2020

Sum Product Numbers and Near Misses

A sum-product number is a number \(n\) such that the sum of its digits times the product of its digit is \(n\) itself. For example:$$135=(1+3+5)\times (1 \times 3 \times 5)$$There are only three sum-product numbers: 1, 135, and 144 (OEIS A038369), although 0 of course could be included if desired.


  A038369

Numbers n such that n = (product of digits of n) * (sum of digits of n).   


Of interest also are numbers such that the sum of their digits times the product of their digit differ from by 1, 2, 3, … The table in Figure 1 shows these initial numbers (source):

Figure 1

The code to determine these initial numbers is shown in Figure 2 with a difference of 6 being used as the example:

Figure 2: permalink

Of course, if the number base is changed (say to 16), an entirely different set of numbers is obtained. In base 16 and with a number difference of 6, the set consists of 3, 482, 554, 582, 7494, 12954. In the case of 12954, it becomes 329A and so the sum of its digits is 3 + 2 + 9 + 10 = 24 and the product of its digits is 3 x 2 x 9 x 10 = 540. The product of 24 and 540 is 12960 which does indeed differ from 12954 by 6. See Figure 3.

Figure 3: permalink

These numbers, in base 10 or any other base, are curiosities and probably, like selfie numbers, not of any deep mathematical significance. However, I did turn 25926 days old recently (March 27th 2020) and that's when I stumbled upon the number thanks to a Wolfram MathWorld link. It features in the set of numbers shown in Figure 2 and it also appears in the table in Figure 1.

Friday 27 March 2020

Selfie Numbers

Today, I turned 25926 days old and was surprised to discover that this is a so-called selfie number. The article in which I discovered this fact began with this abstract which explains what is meant by the term:
Numbers represented by their own digits by certain operations are considered as selfie numbers. Some times they are called wild narcissistic numbers. There are many ways of representing selfie numbers. They can be represented in digit’s order, reverse order of digits, increasing and/or decreasing order of digits, etc. These can be obtained by use of basis operations along with factorial, squareroot, Fibonacci sequence, Triangular numbers, binomial coefficients, s-gonal values, centered polygonal numbers, etc. In this work, we have written selfie numbers by use of concatenation, along with factorial and square-root. The concatenation idea is used in a very simple way. The work is limited up to 5 digits. Work on higher digits shall be dealt elsewhere. Source.
I discovered that 25926 could be expressed as \((−2+5)!! \times C(9,2)+6\). This immediately caused me confusion because I'm use to treating !! as the double factorial in which case we have:$$(-2+5)!!=3!!=3 \times 1 = 3$$However, this produces \(3 \times 36 +6=124\) and so something is wrong. After typing 3!! into a Google search, I saw what was meant (see Figure 1):

Figure 1

So instead of 3!!=3, we have (3!)!=6!=720 and now \(720 \times 36+6\) does give 25926.

The title of the previously mentioned article is:

Concatenation-Type Selfie Numbers
With Factorial and Square-Root


The author of the article, Inder J. Taneja1, categorises the selfie numbers into the following types:

1 Crazy Representations

1.1 Selfie Numbers

2 Concatenation-Type Selfie Numbers

2.1 Sequential Representations
2.1.1 Both Ways
2.1.2 Digit’s Order
2.1.3 Reverse Order of Digits
2.2 Non Sequential Representations
2.2.1 Both Ways
2.2.2 Digit’s Order
2.2.3 Reverse Order of Digits

3 Number Patterns

4 Summary: Selfie Numbers

4.1 Factorial
4.2 Factorial and Square-Root
4.3 Fibonacci Sequence
4.4 Triangular Numbers
4.5 Binomial Coefficients
4.6 S-gonal numbers
4.7 Centered Polygonal Numbers
The author has written a previous paper (it is 161 pages in length) that begins with the following abstract:
Natural numbers from 0 to 11111 are written in terms of 1 to 9 in two different ways. The first one in increasing order of 1 to 9, and the second one in decreasing order. This is done by using the operations of addition, multiplication, subtraction, potentiation, and division. In both the situations there are no missing numbers, except one, i.e., 10958 in the increasing case.
The decreasing case can be written as 10958 = (9 + 8 × 7 × 65 + 4) × 3 − 2 + 1. However, if factorials and square roots are allowed, then more than one representation of the increasing case is possible. Here are two examples:$$10958 := 1+2+3!!+(−4+5!+6−7)×89$$ $$10958 := 1×2×(3!!−4!×(5+6)+7!−8−9)$$The author uses factorials and square roots, as well as additional elements, for his selfie numbers. One of those additional elements is concatenation defined as:$$a \parallel b := 10 \times a + b, a \in \mathbb{Z}, b \in \{ 0, 1, 2, 3, 4, 6, 7, 8, 9 \}$$At first I was confused by the := symbol but I discovered its significance:
It is borrowed from computer programming: it means that the item on the left hand side is being defined to be what is on the right hand side. For example, \(𝑦:=7𝑥+2\) means that \(𝑦\) is defined to be \(7𝑥+2\). This is different from, say, writing \(1=\sin^2 \theta +\cos^2 \theta \). Source.
As an example of its use we have:$$ 2 \parallel 3 := 2 \times 10 + 3 = 23$$$$5 \parallel 15 := 5 × 100 + 15 = 515$$$$ ((3 \times 3) \parallel 1)^2 \times 4:=91^2 \times 4 = 33124$$It is possible to reverse the order of the digits as in the following example:$$39304 := ((4 \parallel 03) − 9) ^3$$Sometimes numbers can be written sequentially both forwards and backwards as in the following example where the square root and factorial are used in addition to concatenation:$$30969 := ((3 + 0!) \parallel \sqrt{9}) \times 6! + 9 = 9 + 6! × ((\sqrt{9}+0!)\parallel 3)$$The author also makes use of the Fibonacci sequence defined as:$$ F(0) = 0, F(1) = 1, F(n + 1) = F(n) + F(n − 1), n ≥ 1$$Below is an example of a selfie number that makes use of the Fibonacci sequence values:$$834660 := (F(8 × 3) × F(4) + 6) × 6 + 0 = 0 + 6 × (6 + F(4) × F(3 × 8))$$The triangular numbers are also used and the general formula for these is:$$T(n) = 1 + 2 + 3 + ... = \frac{n + 1} {2} = C(n + 1, 2)$$Here is an example of a selfie number that makes use of Triangular numbers:$$99633 := 3 + (3 + T(T(6) + T(9))) × T(9)$$As we saw with the example of my daily number, binomial coefficients can be used as well as S-gonal numbers, defined by the following formula:$$P(n, s) := \frac{n \,(n − 1) \, (s − 2) }{2} + n, s > 2$$Here is an example of a selfie number that makes use of S-gonal numbers:$$53995 := (5! − P(9, \sqrt{9})) × 3!! − 5$$Lastly, the author makes use of centered polygonal numbers defined by the formula:$$K(n,t) := \frac{t \, n \, (n − 1)}{ 2} + 1, t > 2$$An example of a selfie number using such numbers is:$$59938 := K(8, 3!) + (\sqrt{9})!! + 9^5 $$There are plenty of examples in the aforementioned paper and, though the arithmetic involved is simply enough once it's displayed, one has to often marvel at the ingenuity required to create the elements in the first place.

Selfie numbers are similar to Friedman numbers except that in the latter the digits can be in any order. A number \(n\)  is a Friedman number if it can be obtained combining all its digits with the 5 arithmetic operations and concatenation (of digits, not of results). For example, 13125 is a Friedman number since it can be written as \(21\times 5^{3+1}\). An impressive example is the pandigital number 9108432576 that can be written as \(251^3 \times 4 \times 6 \times(7 + 8 + 9 + 0) \).

Saturday 21 March 2020

Highly Factorable Numbers

The number of OEIS (Online Encyclopaedia of Integer Sequences) entries for number close to 26000 are not numerous (typically no more than ten). So I was surprised today, having turned 25920 days old, to discover that there were 184 entries in the OEIS for the number 25920. Amongst its many properties was the following(OEIS A0338833):


    A033833

Highly factorable numbers: numbers with a record number of proper factorisations.


The sequence, up to and including 25920, runs as follows:
1, 4, 8, 12, 16, 24, 36, 48, 72, 96, 120, 144, 192, 216, 240, 288, 360, 432, 480, 576, 720, 960, 1080, 1152, 1440, 2160, 2880, 4320, 5040, 5760, 7200, 8640, 10080, 11520, 12960, 14400, 15120, 17280, 20160, 25920
It's easy at first sight to confuse highly factorable with highly composite. However, the terms are not the same. WolframMathWorld defines the latter as:
Highly composite numbers are numbers such that the divisor function$$d(n)=\sigma_0(n)$$In other words, the number of divisors of \(n\) is greater than for any smaller \(n\). 
Figure 1 shows a list of the first 38 highly factorisable numbers and their factorisation. Double click the image to enlarge it.

Figure 1

As can be seen, 25920 does not appear on the list. This is because highly factorable numbers are characterised by the size of their multiplicative partitions (the number of ways in which a positive integer n can be expressed as a product of integers (each greater than 1). The OEIS comments for the sequence A033833 give examples for the initial terms. See Figure 2.

Figure 2

Clearly there is an overlap between between the highly composite and highly factorable numbers but notice that 2 and 6 are missing in the latter. Figure 3 shows a more comprehensive list of the initial highly factorable numbers and their factorisations, obtained from a 1981 paper with Paul Erdos as one of the three contributing authors.

Figure 3

Looking at Figure 3, it can be seen that 25920 sets a record as being able to be represented in 1386 different ways. In other words the size of its multiplicative partition is 1386. This article titled "Additive and Multiplicative Partitions" looks, as its title suggests, at the both types of partitions but no formula for calculating the size of multiplicative partitions emerged. This article title "Multiplicative Partitions" attempts an explanation of the topic and begins:
A phenomenal amount of research has been conducted on the additive partition function  over  the  last  100  years,  with  striking  classical  results  due  to  Hardy, Ramanujan, and others.  In contrast,  the topic of multiplicative partitions — sometimes referred to as  “factorisatio  numerorum”  —  has  received  little  attention.   Counting  the  number  of multiplicative partitions is a natural question since it lies between the two most common questions concerning primes:  “Is \(n\) prime?” and “What is the prime factorization of \(n\)?” 
However, the algorithms that the paper came up with were a little beyond my comprehension. I was hoping to find a SageMath or a Python program that would generate the size of the multiplicative partition of any given integer. In my post of Monday, 11th November 2019, I made mention of these sorts of partitions in the context of Bell numbers:
Factorisations 
If a number \(N\) is a square-free positive integer (meaning that it is the product of some number \(n\) of distinct prime numbers), then Bn gives the number of different multiplicative partitions of \(N\). These are factorisations of N into numbers greater than one, treating two factorisations as the same if they have the same factors in a different order. For instance, 30 is the product of the three primes 2, 3, and 5, and has \(B_3\) = 5 factorisations: 30 = 2×15 = 3×10 = 5×6 = 2×3×5
That works for numbers like 30 but it's no good when the factors are not square free as in 25920. There is a Dirichlet series generating function \(f(s)\) that can be used for this purpose but I don't understand it: $$f(s)=\sum_{n=1}^{\infty}\frac{a_n}{n^s}=\prod_{k=2}^{\infty}\frac{1}{1-k^{-s}}$$I guess I'll keep investigating this matter and more to this post, if and when I discover something.

Wednesday 18 March 2020

Prime Generating Quadratic Polynomials

Today I turned 25919 days old, a prime day as I like to call days of this type, because 25919 is a prime number. Now one of its properties is that it is a member of OEIS A117081:


A117081

\(a(n) = 36 \,n^2 - 810 \,n + 2753\), producing the conjectured record number of 45 primes in a contiguous range of \(n\) for quadratic polynomials, i.e., |\(a(n\)| is prime for \(0 \leq n < 44\).


So the quadratic polynomial is:$$36x^2-810x+2753$$25919 is one of those 45 primes, corresponding to \(x=39\). Here is the list of all 45 primes (with 25919 highlighted in bold):
2753, 1979, 1277, 647, 89, -397, -811, -1153, -1423, -1621, -1747, -1801, -1783, -1693, -1531, -1297, -991, -613, -163, 359, 953, 1619, 2357, 3167, 4049, 5003, 6029, 7127, 8297, 9539, 10853, 12239, 13697, 15227, 16829, 18503, 20249, 22067, 23957, 25919, 27953, 30059, 32237, 34487, 36809
Back in 2018, I posted about Prime Producing Linear Polynomials and now this got me thinking about prime generating quadratic polynomials. SageMathCell makes it easy to investigate these types of polynomials. Figure 1 shows the code that I set up (permalink) for the particularly interesting polynomial:$$2x^2-108x+1259$$
Figure 1

This polynomial produces an impressive 92 primes out of a 100 but only 66 of them are distinct. I found it and others using this online source (see Figure 2 for screenshot).

Figure 2

However, the record of 95 primes out of a 100 is held by this polynomial:$$x^2-69x+1231$$It is related to Euler's polynomial \(x^2+x+41\) by the substitution \(n=m-35\). Anyway, today is special in that it's not only a prime day but the prime under review (25919) is one of a conjectured 45 maximum possible primes produced in a contiguous range of input values for a quadratic polynomial.

Monday 9 March 2020

Random Fibonacci Numbers

I just finished watching the latest Numberphile video on YouTube titled Random Fibonacci Numbers:



To produce these random Fibonacci numbers, what happens is that the previous two members of the sequence are added (as in the normal sequence) OR subtracted (the smaller from the larger) RANDOMLY. 

In the case of the normal Fibonacci sequence, we know that the \(n\)-th root of the \(n\)-th term approaches the golden ratio (1.6180339887…). In the randomised Fibonacci sequence, the \(n\)-th root of the \(n\)-th term approaches 1.319882487943… and this is as accurate as can currently be determined. Interestingly, as \(n\) gets larger, the \(n\)-th term can be a very large positive OR negative number. The SageMath code shown in Figure 1 calculates for 1000 terms and determines positivity or negativity:

Figure 1

Figure 2 shows an example of typical output:

Figure 2


As shown in Figure 3, a simple modification of the code , so that \(a\) must be zero, produces the standard Fibonacci sequence. 


Figure 3

Figure 4 shows an example of typical output:

Figure 4

Now in the normal Fibonacci sequence, the ratio of successive terms approaches \( \phi \) but that doesn't really work for the random Fibonacci sequence which is why the \(n\)-th root of the \(n\)-th term was chosen instead. This gets a little technical and I don't pretend to understand it but I'll quote from Wikipedia:

Johannes Kepler discovered that as \(n\) increases, the ratio of the successive terms of the Fibonacci sequence \(F_n\) approaches the golden ratio \( \phi=(1+\sqrt{5})/2\) which is approximately 1.61803. In 1765, Leonhard Euler published an explicit formula, known today as the Binet formula: $$F_n = \frac{\phi^n-(-1/\phi)^n}{\sqrt 5}$$It demonstrates that the Fibonacci numbers grow at an exponential rate equal to the golden ratio \( \phi \).

In 1960, Hillel Furstenberg and Harry Kesten showed that for a general class of random matrix products, the matrix norm grows as \( \lambda^n\), where \(n\) is the number of factors. Their results apply to a broad class of random sequence generating processes that includes the random Fibonacci sequence. As a consequence, the \(n\)-th root of |\(f_n\)| converges to a constant value almost surely, or with probability one:$$\sqrt[n]{|f_n|} \text{ --> 1.1319882487943 ...  as } n \text{ --> } \infty$$An explicit expression for this constant was found by Divakar Viswanath in 1999. It uses Furstenberg's formula for the Lyapunov exponent of a random matrix product and integration over a certain fractal measure on the Stern–Brocot tree. Moreover, Viswanath computed the numerical value above using floating point arithmetics validated by an analysis of the rounding error.

Sunday 8 March 2020

Prime Weeks

As I number my days, I find that my prime days come and go but every Sunday, the day on which I was born, I know that it can never be a prime day because, whatever its number, it will always be divisible by 7. Today for example is a Sunday and I turned 25907 days old. Now 25907 = 7 x 3701 and so 3701 weeks have now elapsed since I was born. Of interest however, is the fact that 3701 is prime. There have been 517 Sundays where the number was biprime or semiprime.

𝓟𝓡𝓘𝓜𝓔 𝓦𝓔𝓔𝓚


I've chosen to call such weeks, beginning on Sunday, prime weeks. They can never occur consecutively except in the case of the second and third weeks. Each prime week will have its own character as determined by the nature of the larger prime. For example, what is significant about today's 3701?

𝓢𝓤𝓜 𝓞𝓕 𝓢𝓔𝓥𝓔𝓝 𝓟𝓡𝓘𝓜𝓔𝓢


One interesting property is that it is a prime that is itself the sum of seven consecutive primes. This property defines OEIS A082246 whose members, up to and including 3701, consist of the primes:
197, 223, 251, 281, 311, 401, 431, 463, 523, 593, 659, 719, 757, 827, 863, 947, 991, 1063, 1171, 1753, 1901, 2347, 2393, 2647, 2689, 2731, 2777, 2819, 2953, 3347, 3389, 3533, 3643, 3701
It's easy enough to generate this sequence from the following SageMath code:
P=Primes()
L=[]
for i in range(0,1000):
    sum=0
    for j in range(0,7):
        sum+=P[i+j]
    if is_prime(sum):
        L.append(sum)
    if sum==3701:
        break
print(L)
Click here for a SageMathCell permalink to the above code. Thus the themes of primes and sevens are echoed in this property of 3701.

𝓗𝓞𝓜𝓔 𝓟𝓡𝓘𝓜𝓔


3701 is also a member of OEIS A133960: home primes whose homeliness is 3. Without going into the definition of what is meant by a home prime and homeliness (here is the Wikipedia link), it can be seen that 206 = 2 x 103 --> 2103 = 3 x 701 --> 3701 and thus 3701 is a home prime of homeliness 3 because 206, 2103 and 3701 all lead to 3701.

The number 3701 attracts 203 entries in the OEIS so there are probably other properties that are of interest but that will suffice for now. Here is the SageMath code to generate the list of numbered Sundays, up to and including 25907, that start prime weeks:
L=[]
P=Primes()
number=0
for p in P:
        number=p*7
        L.append(number)
        if number==25907:
            break
print(L) 
Here is the permalink.

My next prime week will occur on day 25963 = 7 * 3709 which is 56 days or eight weeks away from today's 9th March 2020. The observance of such days provides, via the analysis of the number associated with that day, another opportunity to discover more about the properties of numbers. Since I began this blog on Wednesday, 30th September 2015, it's amazing how much I've learned and how much more there is to know. My very first post was about Catalan Numbers and was begun when I was 24285 days old.


At that time I knew nothing about SageMath or LaTeX. Even though I'd spent many years teaching Mathematics, my knowledge was largely confined to the topics that were included in the various high school curricula.

on Sunday May 2nd 2021

Thursday 5 March 2020

The Great Pyramid and the Speed of Light

Let's great straight into it. Figure 1 shows the latitude and longitude of the Great Pyramid:

Figure 1

Now let's look at the speed of light in metres per second (see Figure 2):

Figure 2

Figure 3
So there you have it. A remarkable coincidence? Well, predictably Snopes thinks so (see Figure 3). Well, you don't have to look very hard for it. Those six digits in both measurements leap out at you. Could there be more to it? Well, a great deal has been written about the dimensions and location of the Great Pyramid. Today, my email threw up a short paper on ResearchGate from a Robin Spivey with the title:

The Great Pyramid's conspicuous speed 
of light latitude is no accident

Before we go into that, it's necessary to look (as Robin Spivey) does at the dimensions of the Great Pyramid and how those famous constants, \( \pi \) and \( \phi \), are encoded in it. Figure 4 sheds some light on this:
Figure 4

To explain what's going on in Figure 4, we need to start with: $$ \sqrt{\phi} \approx \cfrac{14}{11}  \text{ and }  \pi \approx \cfrac{22}{7}$$These two approximations allow a connection to made between \( \phi \) and \( \pi \), namely that: $$ \sqrt{\phi} \approx \cfrac{4}{\pi} $$Spivey makes the comment that the 14:11 ratio is almost optimal in the sense of providing two approximations of comparable quality for \( \phi \) and \( \pi \).

There is also the approximation: $$ \phi \approx \sqrt{\cfrac{5 \times \pi}{6}} $$Armed with this approximation, it can be said that: $$ \pi - \phi^2 \approx \cfrac{\pi}{6} \approx \cfrac{\phi^2}{5} \approx 0.52356$$This number is very close to the length of the cubit in metres. Furthermore when the number, interpreted as an angle is radians, is converted to degrees, the result is 29.9977018228306 which takes us full circle so to speak.

There's obviously more food for thought here and maybe I'll add to this post in the future. Figure 5 shows some calculations carried out in SageMathCell for these various approximations. Just double-click on the image to enlarge it:

Figure 5

Sunday 1 March 2020

Pentominoes

Today I turned 25900 days old and one of the OEIS entries for this number states:


A248102

Number of tilings of a 5 X 2n rectangle using 2n pentominoes of shapes N, Y.


So 25900 is a member of this sequence, specifically for the case where n=8 and so, when there is a 5 x 16 rectangle (with area 80 square units), it can be tiled with 16 pentominoes (each with an area of 5 square units) in 25900 different ways. The pentominoes must be of type N or Y. Of course, I then had to look up what was meant by a pentomino of type N and type Y. Figure 1 shows the twelve types of free pentominoes, lettered according to the shapes that approximate those letters.

Figure 1: the 12 types of free pentominoes (source)

By free pentominoes, it is meant that chiral versions are not considered distinct. For example, the F pentomino can be lifted out of the plane and turned into its mirror image. If chiral versions are considered distinct, then there are 18 different types. See Figure 2.

Figure 2: The 12 pentominoes can form 18 different shapes,
with 6 of them (the chiral pentominoes) being mirrored. (source)

To quote from Wikipedia:
A standard pentomino puzzle is to tile a rectangular box with the pentominoes, i.e. cover it without overlap and without gaps. Each of the 12 pentominoes has an area of 5 unit squares, so the box must have an area of 60 units. Possible sizes are 6×10, 5×12, 4×15 and 3×20. 
Figure 3 shows some of the possible configurations:

Figure 3

There are many websites where puzzles of this sort can be solved. Figure 4 is a screenshot of one of these sites. Link

Figure 4: link to website

In the screenshot in Figure 4, the 6 x 10 rectangle is to be tiled. There are 2339 ways in which this can be done. For the 5 x 12 case, there are 1010 ways. For the 4 x 15 case, there are 368 ways and for the 3 x 20 case there are just 2 ways. 

There's a lot more that could be said about pentominoes but I'll go on and make some comments about pentacubes which are polycubes made out of five cubes. There are 29 possible pentacubes of which twelve are flat (corresponding to the twelve pentominoes extruded to a depth of 1 unit). Figure 5 shows one of the non-flat pentacubes:

Figure 5: source 

To quote again from Wikipedia:
A standard pentomino puzzle is to tile a rectangular box with the pentominoes, i.e. cover it without overlap and without gaps. Each of the 12 pentominoes has an area of 5 unit squares, so the box must have an area of 60 units. Possible sizes are 6×10, 5×12, 4×15 and 3×20.

Figure 6

The diagrams in Figure 6 do require a little scrutiny but the shapes of the various polycubes do reveal themselves. Obviously, the topics of pentominoes and pentacubes form a rich vein of recreational Mathematics and I'm just grazing the surface in this post. There are other puzzles that involve pentacubes. I'll mention one such puzzle and that is the Bedlam Cube, named after its inventor Bruce Bedlam. To quote from Wikipedia:
The puzzle consists of thirteen polycubic pieces: twelve pentacubes and one tetracube. The objective is to assemble these pieces into a 4 x 4 x 4 cube. There are 19,186 distinct ways of doing so, up to rotations and reflections. The Bedlam cube is one unit per side larger than the 3 x 3 x 3 Soma cube, and is much more difficult to solve. See Figures 7 and 8.
Figure 7: an assembled Bedlam Cube

Figure 8: a disassembled Bedlam Cube 

There are many more puzzles and much more to say about polyominoes and polycubes but I'll leave it at that for the moment. Meanwhile, I've not been idle. My trophy cabinet is shown in Figure 9 with my trophy for attaining Level 4 in Pentominoes.

Figure 9