Monday, 2 November 2020

Van Eck's Sequence

 Today's diurnal number of 26146 turned up the following entry in the OEIS:


A308782



Index of first occurrence of n appearing twice in succession in Van Eck's sequence (A181391), or 0 if it never occurs.


I was naturally curious about how Van Eck's sequence was generated and I found this helpful Numberphile video narrated by Mr. Sloane himself:


The value of \(n\) that occurs twice in succession, for the first time, is 29 and so 26146 refers to the the index position (counting the first zero of the sequence as term 1) of the second 2 in the digit sequence 2929 (marked in bold red). Here are the early terms of the Van Eck sequence showing the situation for 0, 2 and 3 (11 doesn't appear in the sequence):

0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 
6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 0, 3, 3, 1, 42, ... 

The first four terms of the A308782 sequence are 2, 0, 8, 50 corresponding to \(n\) = 0, 1, 2, 3. I was interested in generating the Van Eck sequence using SageMath and below is the code that I came up with (permalink):

L=[0]
for i in [1..100]:
    if L.count(L[i-1])==1:
        L.append(0)
    else:
        m=0
        for x in [0..(i-2)]:
            if L[x]==L[i-1]:
                m=(i-1)-x
        L.append(m)
print(L)

[0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 0, 3, 3, 1, 42, 0, 5, 15, 20, 0, 4, 32, 0, 3, 11, 18, 0, 4, 7, 0, 3, 7, 3, 2, 31, 0, 6, 31, 3, 6, 3, 2, 8, 33, 0, 9, 56, 0, 3, 8, 7, 19, 0, 5, 37, 0, 3, 8, 8, 1, 46, 0, 6, 23]

Here is a link to two different Python 3 algorithms that generate the Van Enk sequence. Figure 1 shows the plot for these first 100 values:

Figure 1

Here is the Van Eck sequence represented as a melody:


Of course, as with the Fibonacci sequence, a starting value other than 0 will produce a different but similar sequence to the Van Eck. My SageMath algorithm is easily modified to investigate such sequences. For example, let's make the first term 1 (permalink):

L=[1]
for i in [1..100]:
    if L.count(L[i-1])==1:
        L.append(0)
    else:
        m=0
        for x in [0..(i-2)]:
            if L[x]==L[i-1]:
                m=(i-1)-x
        L.append(m)
print(L)

[1, 0, 0, 1, 3, 0, 3, 2, 0, 3, 3, 1, 8, 0, 5, 0, 2, 9, 0, 3, 9, 3, 2, 6, 0, 6, 2, 4, 0, 4, 2, 4, 2, 2, 1, 23, 0, 8, 25, 0, 3, 19, 0, 3, 3, 1, 11, 0, 5, 34, 0, 3, 7, 0, 3, 3, 1, 11, 11, 1, 3, 5, 13, 0, 10, 0, 2, 33, 0, 3, 9, 50, 0, 4, 42, 0, 3, 7, 25, 40, 0, 5, 20, 0, 3, 8, 48, 0, 4, 15, 0, 3, 7, 15, 4, 6, 70, 0, 7, 6, 4]

Note that 11 occurs twice quite early on in this sequence whereas in the Van Eck it occurs in the 7224th position. 

Cyclotomic Polynomials

Recently I turned 26142 days and this number has the property that it is a member of OEIS A138938:


A138938

Indices k such that A019326(k)=\( \Phi_8\) is prime, where \( \Phi \) is a cyclotomic polynomial.

I've heard many times about cyclotomic polynomials over the past five years without really understanding their significance. This occasion provided an opportunity to investigate the topic further. I discovered that SageMath (which I use for most of my calculations) has a function to generate the cyclotomic polynomials. The following simple command will generate the first twenty cyclotomic polynomials:

for n in [1..20]:

    print(n,"-->",cyclotomic_polynomial(n,x))

\( \Phi_1 = x - 1\)

\( \Phi_2 = x + 1\)

\( \Phi_3 = x^2 + x + 1\)

\( \Phi_4 = x^2 + 1\)

\( \Phi_5 = x^4 + x^3 + x^2 + x + 1\)

\( \Phi_6 = x^2 - x + 1\)

\( \Phi_7 = x^6 + x^5 + x^4 + x^3 + x^2 + x + 1\)

\( \Phi_8 = x^4 + 1\)

\( \Phi_9 = x^6 + x^3 + 1\)

\( \Phi_{10} = x^4 - x^3 + x^2 - x + 1\)

\( \Phi_{11} = x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1\)

\( \Phi_{12} = x^4 - x^2 + 1\)

\( \Phi_{13} = x^{12} + x^{11} + x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1\)

\( \Phi_{14} = x^6 - x^5 + x^4 - x^3 + x^2 - x + 1\)

\( \Phi_{15} = x^8 - x^7 + x^5 - x^4 + x^3 - x + 1\)

\( \Phi_{16} = x^8 + 1\)

\( \Phi_{17} = x^{16} + x^{15} + x^{14} + x^{13} + x^{12} + x^{11} + x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1\)

\( \Phi_{18} = x^6 - x^3 + 1\)

\( \Phi_{19} = x^{18} + x^{17} + x^{16} + x^{15} + x^{14} + x^{13} + x^{12} + x^{11} + x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1\)

\( \Phi_{20} =  x^8 - x^6 + x^4 - x^2 + 1\)


But what are the cyclotomic polynomials, or cyclotomic polynumbers as they are also called, and why are they important? A definition of a cyclotomic polynumber is that it is an irreducible polynumber with integer coefficients, \(n=1,2,3,...\) such that:$$ 1-x^n=\prod_{d|n} \Phi_d \text{ where } d\text{ are the divisors of } n$$By irreducible is meant they cannot be factored into a product of polynomials of lesser degree. In this respect, these polynumbers are like prime numbers. The name cyclotomic arrives from the view of these polynumbers being solutions to \(1-z^n\) on the complex plane. The solutions lie on the unit circle and can be thought of as cutting up this circle into \(n\) sectors (see Figure 1 that shows the solutions to \(1-z^{10}=0\)).


Figure 1

From the earlier definition it can be seen that:$$1-z^{10}=\Phi_1 \times \Phi_2 \times \Phi_5 \times \Phi_{10} \text{ and so}$$ $$1-z^{10}=(z-1)(z+1)(z^4 + z^3 + z^2 + z + 1)(z^4 - z^3 + z^2 - z + 1)$$There are some other interesting results, including:$$ \Phi_p=1+x+x^2+...+ \,x^{p-1} \text{ where } p \text{ is prime }$$Looking at the cyclotomic polynumbers shown at the beginning of this post, it can be seen that \( \Phi_2, \Phi_3, \Phi_5, \Phi_7, \Phi_{11}, \Phi_{13}, \Phi_{17} \text{ and } \Phi_{19} \) follow this pattern. Another interesting result is that:$$ \Phi_{p^k}=\Phi_p(x^{p^{k-1}}) \text{ with } p \text{ again prime }$$An example illustrating the previous result is: $$\Phi_9=\Phi_{3^2}=\Phi_3(x^3)=1+x^3+(x^3)^2 + 1=1+x^3+x^6$$Another property of cyclotomic polynumbers is that:$$ \Phi_{pm} \Phi_m=\Phi_m(x^p) \text{ where } p \text{ is prime and gcd}(p,m)=1$$This result could be used to find \( \Phi_{60}\) in terms of lesser polynumbers because 60 = 5 x 12 and so:$$\Phi_{60}\; \Phi_{12}=\Phi_{12}(x^5) = (x^5)^4 - (x^5)^2 + 1 = x^{20}-x^{10}+1$$ $$ \Phi_{60}= \frac{x^{20}-x^{10}+1}{x^4 - x^2 + 1}=1+x^2-x^6-x^8-x^{10}+x^{14}+x^{16}$$Another useful result arising from the previous result as the case where \(p=2\) is:$$ \Phi_{2m} \; \Phi_m=\Phi_m(x^2) \text{ where } m \text{ is odd }$$ $$ \text{ Hence } \Phi_{2m}= \frac{\Phi_m(x^2)}{\Phi_m}$$As a particular example, let's work out \( \Phi_{14} \) where of course 14 = 2 x 7:$$ \Phi_{14}=\frac{\Phi_7(x^2)}{\Phi_7}=\frac{1+x^2+x^4...+ \, x^{12}}{1+x+x^2+...+ \, x^6}=1-x+x^2-x^3+x^4-x^5+x^6$$Lastly, for this post at least, it can be noted that there is a connection with Euler's totient function via the relationship:$$ \text{ degree of } \Phi_n=\phi(n) \text{ where } \phi \text{ is Euler's totient function}$$We can see this result at work if we look at say \( \Phi_{12} = x^4 - x^2 + 1\) which has degree 4 and \(\phi(12)=4 \) since the numbers that are coprime to 12 are 1, 5, 7 and 11. I'd like to thank N. J. Wildberger's Insights into Mathematics YouTube channel for providing some of the examples and information in this blog post. Here is a link to this channel's videos on Cyclotomic Polynomials:
Cyclotomic polynumbers fall into the category of algebraic number theory and what's interesting about N. J. Wildberger's approach is that he doesn't feel complex numbers (falling into the category of Complex Analysis) should be used to explain their properties. Of course, I've only scratched the surface of this topic but at least I've made a start that I can build on in later posts.

Friday, 30 October 2020

Gaps between Deficient Numbers

An alternative title for this post could have been Runs of Abundant Numbers because the two topics are complementary. Today I turned 26143 days old and one of this number's properties is that it's a member of OEIS A317049.


A317049

Numbers \(k\) such that both \(k\) and \(k\) + 3 are consecutive deficient numbers.


At first, this didn't seem all that significant a property, until one looks at the sequence and realises that this is a relatively rare occurrence. Below are the members less than 100,000:

5774, 5983, 7423, 11023, 21734, 21943, 26143, 27403, 39374, 43063, 49663, 56923, 58694, 61423, 69614, 70783, 76543, 77174, 79694, 81079, 81674, 82003, 84523, 84643, 89774, 91663, 98174, ...

Figure 1
As Figure 1 shows, the usual pattern is a run of deficient numbers punctuated by an abundant number. This is because approximately three out of every four numbers will be deficient. The following SageMath algorithm (permalink) will generate the above sequence of numbers:

L=[]
gap=3
for n in [1..100000]:
    N=[]
    for i in [0..gap]:
        difference=(n+i)-(sigma(n+i)-(n+i))
        N.append(difference)
    if N[0]>0 and N[gap]>0:
        OK=1
        if gap>1:
            for i in [1..(gap-1)]:
                if N[i]>0:
                    OK=0
        if OK==1:
            L.append(n)
print(L)

The obvious question then is where do runs of three abundant numbers occur or where do we find numbers \(k\) such that both \(k\) and \(k\) + 4 are consecutive deficient numbers. Well this occurs between between 171078829 and 171078833, where these two are consecutive deficient numbers. In other words, the consecutive abundant numbers are 171078830, 171078831 and 171078832.

The starting term of the smallest consecutive 4-tuple of abundant numbers is at most:

141363708067871564084949719820472453374

and so 141363708067871564084949719820472453373 to 141363708067871564084949719820472453378 is probably the smallest \(k\) to \(k\)+5 case.

See OEIS A094268 for more information. Thus it will be another 1260 days before there is another run of two abundant numbers. Note that most abundant numbers are even, so if two abundant numbers are to be adjacent then one of them must be odd which is rare. Returning to the deficient 26143 (the number that prompted this post), it can be noted that 26144 is even and abundant while 26145 is odd and abundant. Furthermore, 26145 is an odd primitive abundant number, meaning that none of its proper divisors is abundant. Such numbers form OEIS sequence A006038:


A006038

Odd primitive abundant numbers.         


The sequence, up to 26145, runs:

945, 1575, 2205, 3465, 4095, 5355, 5775, 5985, 6435, 6825, 7245, 7425, 8085, 8415, 8925, 9135, 9555, 9765, 11655, 12705, 12915, 13545, 14805, 15015, 16695, 18585, 19215, 19635, 21105, 21945, 22365, 22995, 23205, 24885, 25935, 26145

Wednesday, 28 October 2020

Phi - Sigma Loops

Yesterday I turned 26140 days old and one of this number's properties is that it is a member of OEIS A095953:


A095953



Initial values for f(x) = phi(sigma(x)) such that iteration of f ends in a cycle of length 3.


In the case of 26140 we get:
  • \( \phi(\sigma_1(26140))=15552 \)
  • \( \phi(\sigma_1(15552))=18144 \)
  • \( \phi(\sigma_1(18144))=15840 \)
  • \( \phi(\sigma_1(15840))=15552 \)
Thus there is a cycle of length 3. 

This got me thinking about what other cycles exist. What I found was that cycles of 1, 2, 3, 4 and 6 are possible but not cycles of 5 or cycles greater than 6. Between 1 and 26200, the percentages for the cycles of 6, 4, 3, 2 and 1 are about 5.5%, 3.4%, 6.2%, 15.3% and 69.6% respectively (for a total of 100%). Clearly, a cycle of 1 is by far the most common. See Figure 1.

Figure 1

This is not to say that other cycles are not possible but the percentages shown in Figure 1 hold true for the first 26200 numbers. The following SageMath algorithm (permalink) will determine those numbers with a cycle of 3 within a given range. The range and cycle size are easily modified:

L,cycle=[],3
for n in [26100..26200]:
    count,number,M = 0,n,[n]
    for i in [1..7]:
        number=euler_phi(sigma(number))
        if number in M:
            break
        M.append(number)
    for i in range(len(M)):
        if M[i]==number:
            count=len(M)-i
    if count==cycle:
        L.append(n)
print(L)

[26118, 26120, 26140, 26166]

Tuesday, 20 October 2020

Sums of Cubes

 I've written about cubic numbers before, specifically in posts titled:

  • Cubic Numbers from the 11th January 2016 in which I discuss turning \(29^3\) days old
  • Cuban Primes from the 11th July 2016 in which I discuss primes that are the difference of two consecutive cubes
  • Sums of Cubes and Squares of Sums from the 31st July 2018 in which I discuss with the property that the sum of the cubes of their digits is equal to the square of the sums of their digits
  • Platonic Numbers from the 20th November 2018 in which I discuss cubes or cubic numbers as being one type of platonic number along with tetrahedral, octahedral, icosahedral and dodecahedral numbers.
  • 42 is the new 33 from the 1st April 2019 in which I report on the discovery that 33 is expressible as a sum of three signed cubes and that only 42 remains to be cracked.
  • 42 from the 9th September 2019 in which I report on the discovery is expressible as a sum of three signed cubes and that a new way of expressing 3 as a sum of three signed cubes was discovered
  • The Original Taxi Cab Number in a New Light from the 21st December 2019 in which I discuss 1729 and centred cube numbers
In this post, I'll examine 26132 that has the interesting property that it can be expressed as a sum of six cubes in three possible ways. It is a member of OEIS A048931


A048931

Numbers that are the sum of 6 positive cubes in exactly 3 ways.      
    What's remarkable about 26132 is that it's the last such number with this property. Beginning with 221, the sequence has 1141 members and 26132 is the last member. It is expressible as the sum of the following cubic numbers: [8, 2744, 2744, 3375, 8000, 9261], [64, 1331, 2744, 4913, 4913, 12167] and [512, 512, 2197, 2744, 8000, 12167].

    From WolframMathWorld we learn that:
    • 23 and 239 are the only integers requiring nine positive cubes
    • only 15 integers require eight cubes: 15, 22, 50, 114, 167, 175, 186, 212, 231, 238, 303, 364, 420, 428, and 454 
    The same source also provides the following table that gives the first few numbers which require at least N = 1, 2, 3, ..., 9 (i.e., N or more) positive cubes to represent them as a sum.

    nOEISnumbers
    1A0005781, 8, 27, 64, 125, 216, 343, 512, ...
    2A0033252, 9, 16, 28, 35, 54, 65, 72, 91, ...
    3A0477023, 10, 17, 24, 29, 36, 43, 55, 62, ...
    4A0477034, 11, 18, 25, 30, 32, 37, 44, 51, ...
    5A0477045, 12, 19, 26, 31, 33, 38, 40, 45, ...
    6A0460406, 13, 20, 34, 39, 41, 46, 48, 53, ...
    7A0188907, 14, 21, 42, 47, 49, 61, 77, ...
    8A01888915, 22, 50, 114, 167, 175, 186, ...
    9A01888823, 239

    Again, the same source provides the following table that gives the numbers which can be represented in exactly \(W\) different ways as a sum of \(N\) positive cubes.

    NWOEISnumbers
    10A0074122, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, ...
    11A0005781, 8, 27, 64, 125, 216, 343, 512, ...
    20A0579031, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, ...
    212, 9, 16, 28, 35, 54, 65, 72, 91, ...
    22A0188501729, 4104, 13832, 20683, 32832, ...
    23A00382587539319, 119824488, 143604279, ...
    24A0038266963472309248, 12625136269928, ...
    2548988659276962496, ...
    268230545258248091551205888, ...
    30A0579041, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, ...
    31A0253953, 10, 17, 24, 29, 36, 43, 55, 62, ...
    32251, ...
    40A0579051, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, ...
    41A0254034, 11, 18, 25, 30, 32, 37, 44, 51, ...
    42A025404219, 252, 259, 278, 315, 376, 467, ...
    50A0579061, 2, 3, 4, 6, 7, 8, 9, 10, 11, 13, 14, 15, ...
    51A0489265, 12, 19, 26, 31, 33, 38, 40, 45, ...
    52A048927157, 220, 227, 246, 253, 260, 267, ...
    60A0579071, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, ...
    61A0489296, 13, 20, 27, 32, 34, 39, 41, 46, ...
    62A048930158, 165, 184, 221, 228, 235, 247, ...
    63A048931221, 254, 369, 411, 443, 469, 495, ...

    In the final row of the above table, we see the sequence to which 26132 belongs. There's a lot more of course that could be said about numbers formed from the sum of cubes but what we do know is that, after 26132, there are no more numbers that can be formed from six cubes in only three ways. How we know this, I don't know!

    Friday, 16 October 2020

    Heronian Triangles and Tetrahedra

    I have mentioned Heronian triangles tangentially in a post of Saturday, 2nd December 2017 when dealing with the number 25080. This number is the area of a so-called almost equilateral triangle with sides of 240, 241 and 241. In that post, I stated that:

    A close-to-equilateral integer triangle is defined to be a triangle with integer sides and integer area such that the largest and smallest sides differ in length by unity. The first five close-to-equilateral integer triangles have sides (5, 5, 6), (17, 17, 16), (65, 65, 66), (241, 241, 240) and (901, 901, 902).

    Figure 1
    This triangle is also an example of an Heronian triangle which is simply any triangle with integer sides that also has an integer area. The simplest example is such as a triangle is right-angled with sides of 3, 4 and 5 (see Figure 1). The area of the triangle is 6 square units. From any right-angled Heronian triangle, two isosceles Heronian triangle can be constructed. For example, the 3, 4, 5 right-angled triangle leads to the 5, 5, 6 and the 5, 5, 8 isosceles triangles.

    I was reminded of Heronian triangles by my diurnal age today which is 26129. This number has the following property:


    A306626




    Numbers that set a record for occurrences as longest side of a primitive Heronian triangle.


    A primitive Heronian triangle is one in which the greatest common divisor of the three sides is 1. The 3, 4, 5 triangle is primitive but the 6, 8, 10 triangle, though still Heronian, is not primitive because the greatest common divisor is 2. Figure 2 shows these record numbers up to 15725:

    Figure 2
    The list of numbers up to 26129 is as follows:

    1, 5, 13, 17, 37, 52, 65, 85, 119, 125, 145, 221, 325, 481, 697, 725, 1025, 1105, 1625, 1885, 2465, 2665, 3145, 5525, 6409, 15457, 15725, 26129

    As can be seen from the table in Figure 2, the number of possible triangles with a longest side of 15725 is 463 but no figure is available for the number of Heronian triangles with a longest side of 26129. The algorithm I developed to calculate the number works fine for smaller sides but times out for larger numbers. Here is a permalink to the code.

    Of course the Heron whose name is being used to identify these types of triangles is the same person responsible for Heron's formula that states the area \(A\) of a triangle whose sides have lengths \(a, b, c\) is:$$A=\sqrt{s(s-a)(s-b)(s-c)} \text{ where } s=\frac{a+b+c}{2}$$It was interesting to learn that a shape is called equable if its perimeter equals its area. There are only five equable Heronian triangles and these have sides (5,12,13), (6,8,10), (6,25,29), (7,15,20), and (9,10,17). As another former Mathematics teacher pointed out in a blog post on Heronian triangles:
    Students, or teachers, who liked "The Hitchhiker's Guide to the Galaxy" may enjoy the 7-15-20 triangle which has both perimeter and area of 42. Author Douglas Adams set 42 as the answer to "life, the universe, and everything" and Tony Crilly and Colin Fletcher have dubbed this the "hitchhiker triangle."
    There is another category of Heronian triangles that is of interest. Since the area of an equilateral triangle with rational sides is an irrational number, no equilateral triangle is Heronian. However, there is a unique sequence of Heronian triangles that are "almost equilateral" because the three sides are of the form \(n − 1, n, n + 1\). Some of these are listed in Figure 3. These are very similar to the "close-to-equilateral" triangles, mentioned at the start of this blog, that are of the form \(n,n,n+1\) or \(n-1,n-1,n\). 

    Figure 3: source

    The numbers in column 2, the \(n\) column, form a Lucas sequence defined by$$a_n = 4 \times a_{n-1} - a_{n-2} \text{ with } a_0 = 2 \text{ and } a_1 = 4$$Alternatively, the formula \( (2+\sqrt{3})^n+(2-\sqrt{3})^n\) will generate all the terms. 

    There's a lot more to said about Heronian triangles. For example, let's venture into three dimensions and an Heronian tetrahedron defined as a not necessarily regular tetrahedron whose sides, face areas, and volume are all rational numbers. It therefore is a tetrahedron all of whose faces are Heronian triangles and additionally that has rational volume. Figure 4 shows the integer Heronian tetrahedron having smallest maximum side length. It has edge lengths 51, 52, 53, 80, 84, 117; faces (117, 80, 53), (117, 84, 51), (80, 84, 52), (53, 51, 52); face areas 1170, 1800, 1890, 2016; and volume 18144. 

    Figure 4: source

    The integer Heronian tetrahedron with smallest possible surface area and volume has edges 25, 39, 56, 120, 153, and 160; areas 420, 1404, 1872, and 2688 (for a total surface area of 6384) and volume 8064. The smallest examples of integer Heronian tetrahedra composed of four identical copies of a single acute triangle (i.e., disphenoids) have pairs of opposite sides (148, 195, 203), (533, 875, 888), (1183, 1479, 1804), (2175, 2296, 2431), (1825, 2748, 2873), (2180, 2639, 3111), (1887, 5215, 5512), (6409, 6625, 8484), and (8619, 10136, 11275). An Heronian tetrahedron is sometimes called a perfect tetrahedron.

    Monday, 12 October 2020

    Subfactorials, Semifactorials and Others

    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$$