Let's suppose that \(n\), \(x\) and \(y\) are positive integers such that:$$n^{\, x+y}=x||y$$where \(x||y\) represents the concatenation of \(x\) and \(y\). What values of \(n\), \(x\) and \(y\) satisfy this equation? Well it seems that there is only one set of values, namely \(n=2\), \(x=3\) and \(y=2\) where$$2^{3+2}=32$$This curious fact struck me when looking at the periodicity of conjunctions of Mars and Venus, that occur in almost the same location in the tropical zodiac at intervals 32 years (+0.5 to 4 days). See my post Periodicity of Mars-Venus Conjunctions.
This got me thinking about what other interesting properties the number 32 might possess. Naturally I turned to Numbers Aplenty to find out.
32 can be written using four fours as in \( (4+4)^{\! ^{\frac{\sqrt{\overline{.4}}}{.4}}} \) where:$$\sqrt{\overline{.4}}=\sqrt{\frac{4}{9}}=\frac{2}{3}\\\ \frac{\frac{2}{3}}{.4}=\frac{\frac{2}{3}}{\frac{2}{5}}=\frac{5}{3}\\(4+4)^{\! ^{\frac{5}{3}}}=8^{\! ^{\frac{5}{3}}}=\left ( 2^3 \right )^{ \!\frac{5}{3}}=2^5=32$$Actually this is not a property unique to 32. In fact, all the numbers up 112 can be represented thus and 113 is the smallest natural number that cannot be obtained using four fours, the common arithmetic operations, factorial, roots, and the notations$$.4=0.4=\frac{2}{5} \text{ and }\overline{.4}=0.4444\dots=\frac{4}{9}$$The use of the vinculum or overline is potentially confusing because the symbol is also used for the rising factorial as in:$$4^{\overline{4}}=4 \times 5 \times 6 \times 7=840$$I've always used the overdot as in \( 0.\dot{4}=0.4444 \dots\) to represent the repeating decimal.
There are other ways to represent 32 using four fours:$$4!! \times 4 + 4 -4 = 32\\4^{\sqrt{4}}+4^{\sqrt{4}}=32\\4 \times 4+4 \times 4=32$$The use of the double factorial can be noted in the previous example, viz. 4!!= 4 x 2 = 8. When attempting the four fours representation, it needs to be made clear what's allowable. If the simple factorial is allowed (4!= 4 x 3 x 2 = 24), then it needs to be determined whether the double factorial (4!!=4 x2) and subfactorial (!4 = 9) are also permitted. I've written about the various types of factorials in my post Subfactorials, Semifactorials and Others. It's also in this post that I address the problem of representing 10 using three threes, which involves the use of the subfactorial (!3=2).
The key to solving these puzzles is the collect various building blocks. These might include (depending on what's allowed):
\(\sqrt{4}=2\)
\(4!=24\)
\(4!!=12\)
\(4^{\overline{4}}=840\)
\(!4=9 \)
\(.\dot{4}=0.4444 \dots =4/9 \)
Four fours is just one of a variety of mathematical puzzles that attempt to represent the counting numbers in terms of a fixed number of identical digits, according to certain prescribed rules. Here are links to a variety of representations:
I've written about subfactorials before in a post titled Derangements on Sunday, 13th January 2019 where I explained that:
There are formulae and examples of subfactorials (derangements) aplenty there, so in this post I'm going to focus on what rekindled my interest. It was a YouTube video that I'll link to later and the problem posed was to connect the 3's shown in Figure 1 by mathematical operations so the LHS = RHS.
Figure 1
It wasn't made clear what constituted mathematical operations. Certainly the basic arithmetical operations of addition, subtraction, multiplication, division and exponentiation are sufficient, together with brackets, to balance most of the equations in Figure 1. For example:
\( (3-3) \times 3 =0\)
\(3^{3-3} = 1 \)
\(3+3-3=3 \)
\( \frac{3}{3}+3=4\)
\(3 \times 3 - 3=6 \)
\( 3 + 3 + 3 =9 \)
However, for 5, 7 and 8, the factorial is required as shown in Figure 2 where some alternative solutions for the numbers 0, 1, 2, 3, 4, 6 and 9 are shown:
Figure 2
The final problem of balancing the three 3's with 10 does not yield even to the factorial. It's here that the subfactorial is required. Firstly, let's list the subfactorials, up to ten using SageMathCell (permalink) as shown in Figure 3.
Figure 3
It can be seen that subfactorial 3, which we'll write as !3, is equal to 2 and that's what we need to balance the equation. Specifically:$$3! + !3 +!3=6+2+2=10$$If other mathematical operations such as log, square root and differentiation are allowed, then some other solutions are possible, as shown in Figure 4.
Figure 4
Clearly, the subfactorial offers the simplest solution. Here is the video from which the above screenshots were taken:
So much for subfactorials. What are semifactorials? Well, the semifactorial or double factorial of a number \(n\), denoted by \(n!! \) is the product of all the integers from \(1\) up to \(n\) that have the same parity (odd or even) as \(n\). Thus \(5!! = 5 \times 3 \times 1 \) and \( 4!! = 4 \times 2 \). The factorial function iterated twice should be written as \((5!)! = 6.689503 \times 10^{198}\), a very large number. However, the Google Calculator will return this same result when 5!! is entered and thus does not recognise the semifactorial.
The nomenclature associated with factorials can be quite confusing. For example, when the double factorial or semifactorial is odd, it's sometimes called the odd factorial. Thus the odd factorial of 5 is 5 x 3. To confuse matters even more, there's the falling factorial and the rising factorial and this pair goes by a variety of names as well. The former can be referred to as the descending factorial, the falling sequential product, or the lower factorial while the latter can be referred to as the Pochhammer function, the Pochhammer polynomial, the ascending factorial, the rising sequential product, or the upper factorial.
Again, there are different ways of representing the falling and rising factorials. The respective different representations and definitions are shown below:$$(x)_n = x^{\underline{n}} = x(x-1)(x-2)\cdots(x-n+1) = \prod_{k=1}^n(x-k+1) = \prod_{k=0}^{n-1}(x-k)$$ $$x^{(n)} = x^{\overline{n}} = x(x+1)(x+2)\cdots(x+n-1) = \prod_{k=1}^n(x+k-1) = \prod_{k=0}^{n-1}(x+k)$$Clearly, there's some need for standardisation in the world of factorials. Anyway, let's apply these different sorts of factorials to the number 5, just to highlight the differences:
factorial \(5\) is represented as \(5! =120\)
factorial \(5\) iterated twice is represented as \((5!)! = 6.689503 \times 10^{198}\)
double factorial \(5\) is represented as \(5!! = 5 \times 3 \times 1 = 15 \)
\( 5^{\underline{3}}\) would be a falling factorial, equal to \(5 \times 4 \times 3 = 60\)
\( 5^{\overline{3}}\) would be a rising factorial, equal to \(5 \times 6 \times 7 = 210\)
Returning to the 3 3 3 = 10 problem, the rising factorial can be used to provide another solution, namely:$$\frac{3^{\overline{3}}}{3!}=\frac{3 \times 4 \times 5}{3 \times 2 \times 1}=\frac{60}{6}=10$$
Today I turned 25487 days old and the first OEIS entry for this number is A002467:
Given \(n\) letters and \(n\) envelopes, how many ways are there to fill the envelopes so that at least one letter goes into its right envelope?
It took some further investigation to realise that this sequence was closely related to OEIS A000166 the numbers of derangements of \(n\): 1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496, 1334961, 14684570, 176214841, 2290792932, ...
In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, derangement is a permutation that has no fixed points.
The number of derangements of a set of size \(n\), usually written \(Dn\), \(dn\), or \(!n\), is called the "derangement number" or "de Montmort number". (These numbers are generalised to rencontres numbers.) The subfactorial function (not to be confused with the factorial \(n!\)) maps \(n\) to \(!n\). No standard notation for subfactorials is agreed upon; \(n¡\) is sometimes used instead of \(!n\).
The problem of counting derangements was first considered by Pierre Raymond de Montmort in 1708; he solved it in 1713, as did Nicholas Bernoulli at about the same time.
To construct the formula, let's consider \(n\) letters and \(n\) envelopes. The first envelope can be filled in \(n-1\) ways and, for the second envelope, there are two possibilities. If the second envelope is filled with the first letter, then the first and second letters are taken care of the problem is reduced to \(n-2\) envelopes and \(n-2\) letters. If this does not happen, then there are now \(n-1\) envelopes and \(n-1 \) letters. This can be written as: $$ !n=(n-1)(!(n-1)+!(n-2))$$From here a formula can be derived to calculate the derangements for \(n\) items, specifically:$$!n=n! \sum_{i=0}^{n} \frac{(-1)^n}{i!}$$For this formula !0=1 and !1=0. In the case of 8 letters and 8 envelopes, we get: !8 = 14833.
One letter has ended up in the right envelope. There are 25487
ways in which at least one letter will end up in the right envelope.
So 14833 is the number of ways that no letters end up in the right envelopes. We are interested in the number of ways that at least one letter will end up in the right envelope. So 14833 needs to be subtracted from 8! = 40320 (the total number of possibilities) to get 25487.
Let's look at how the probability of a derangement changes as the number of elements increases. It can be noted that the Taylor Series for the function \(f(x)=1/e^x\) is given by:$$
\frac{1}{e^x}= \sum_{i=0}^{\infty} \frac{(-1)^i x^i}{i!}
$$So when \(x=1\), it can be seen that \(1/e\) is identical to the formula for the derangements:$$
\frac{1}{e}= \sum_{i=0}^{\infty} \frac{(-1)^i}{i!} \approx 0.3678794412
$$So after about four elements, the probability of a derangement quickly settles down to about 37%, no matter what the number of elements. Here is a link to a paper on derangements that begins:
A group of \(n\) men enter a restaurant and check their hats. The hat-checker is absent minded, and upon leaving, she redistributes the hats back to the men at random. What is the probability \(P_n\) that no man gets his correct hat, and how does \(P_n\) behave as \(n \rightarrow \infty\)?
Here are two Numberphile videos on Derangements with James Grimes presenting. The first is an introduction and the second derives a proof for the formula: