Monday 31 January 2022

One Step Away

I've written about home primes before in the following posts:

I was reminded of the term again today when I was searching for properties associated with the number representing my diurnal age: 26601. This was one of those numbers that crop up from time to time that seemingly, after exhausting all my usual resources, have no interesting properties. Of course, they invariably do and it's up to me to discover them.

After some time, I hit on the idea of home primes. These are the primes formed when the factors of a composite number are concatenated to form a new number. The process is continued until a prime number is reached. For example, let's consider the number 9 that has a home prime of 311.

9 = 3 x 3 → 33 = 3 x 11 → 311 which is prime

It occurred to me that 26601 = 3 x 8867 --> 38867 is prime. In other words, it only takes one step for 26601 to get to its home prime. Some numbers, the smallest being 49, haven't been shown as yet to reach a home prime but I've written about these Home Primes post. What I was interested in here was finding all the numbers in the range up to 40,000 that reach their home primes in only one step.

I developed a SageMath algorithm (permalink) to find these numbers and it turns out that there are 6699 of them, representing about 16.7% of the total numbers in the range. These numbers form OEIS A046411


A046411



Composite numbers the concatenation of whose prime factors is a prime.



The initial members of the sequence are:
6, 12, 18, 21, 22, 28, 33, 39, 46, 51, 52, 54, 58, 63, 66, 70, 82, 84, 93, 98, 111, 115, 117, 133, 141, 142, 148, 154, 159, 162, 165, 166, 171, 172, 175, 177, 182, 187, 198, 201, 205, 207, 210, 219, 220, 226, 232, 235, 237, 245, 246, 247, 249, 253, 255, 261, 262, 264, 266, 267, 268, 274, 279, 282, 291, 292, 294, 297, 301, 310, 319, 327, 338, 350, 355, 358, 376, 384, 385, 387, 388, 391, 392, 399, 406, 408, 411, 423, 426, 427, 430, 432, 434, 435, 436, 440, 442, 459, 468, 472, 475, 476, 478, 489, 494, 498, 501, 502, 504, 505, 511, 516, 525, 531, 534, 535, 538, 543, 549, 552, 562, 565, 568, 573, 574, 583, 584, 586, 589, 595, 598, 608, 615, 620, 622, 628, 630, 632, 639, 657, 664, 679, 684, 686, 687, 694, 696, 697, 705, 721, 728, 741, 742, 752, 753, 756, 759, 763, 766, 771, 772, 775, 778, 781, 783, 786, 790, 793, 798, 799, 801, 804, 813, 816, 819, 820, 833, 835, 837, 856, 860, 871, 872, 875, 884, 885, 888, 889, 895, 901, 904, 916, 921, 924, 930, 934, 938, 939, 943, 946, 949, 963, 968, 985, 993, ...

So I had my "interesting" property now for 26601 and duly tweeted about it. See Figure 1:


Figure 1: source

I was interested as expected in runs of such numbers. How many pairs, triplets, quadruplets etc. are there in a given range. I decided to extend my range to one million and see what came up. What I found is that there are:
  • 137125 singletons representing 13.7% of the numbers in the range
    (remember it was 16.7% in the range up to 40,000): link

  • 18854 pairs of numbers representing 37708 numbers or 3.77%: link

  • 2557 triplets representing 7671 numbers or 0.767%: link

  • 358 quadruplets representing 1432 numbers or 0.143%

  • 50 quintuplets representing 250 numbers or 0.0250%

  • sextuplets representing 54 numbers or 0.00540%

  • 2 septuplets representing 14 numbers or 0.00140%

  • 1 octuplet representing 8 numbers or 0.000800%
These pairs, triplets, quadruplets, quintuplets, sextuplets, septuplets and octuplets are not necessarily stand-alone. For example, the two septuplets, beginning with 45162 and 45163, together form the octuplet 45162, 45163, 45164, 45165, 45166, 45167, 45168, 45169 (see post titled What's Special About 45162? uploaded on September 3rd 2022). I could modify the algorithm to generate stand-alone groups but I think the overview I've given is sufficient.

Sunday 30 January 2022

Lehmer Numbers

The number 26599 is, amongst other things, a 3-Lehmer number which means that:$$\phi(26599)|(26599-1)^3$$In other words, the totient of the number divides the number less one raised to the third power. So let's generalise this statement and say that a number \(n\) is a \(k\)-Lehmer number if:$$\phi(n)|(n-1)^k$$However, the totient of a prime number \(p\) is \( (p-1) \) and so clearly all prime numbers could be regarded as Lehmer numbers and so prime numbers are excluded and only composite numbers considered.

Another point is that every \(k\)-Lehmer number is also \((k+1)\)-Lehmer and so it makes sense to impose the condition that, for a number to be considered \(k\)-Lehmer, it should not be \((k-1)\)-Lehmer. That being said let's consider 1-Lehmer numbers or numbers such that: $$\phi(n)|(n-1)$$Well, clearly all prime numbers satisfy this condition but we have excluded them and are considering only composite numbers. Are there any composite numbers that satisfy the condition? We don't know. To quote from Numbers Aplenty:

The existence of a composite 1-Lehmer number (usually simply called Lehmer number) is still an open problem and several results have been proved about these numbers (which probably do not exist). For example, Cohen and Hagis have proved that such a number, if it exists, must be greater than \(10^{20}\) and be the product of at least 14 primes.

So that takes us to 2-Lehmer numbers or numbers such that:$$\phi(n)|(n-1)^2$$There are only 36 of these in the range up to one million with 561 being the smallest. They are (permalink):

561, 1105, 1729, 2465, 6601, 8481, 12801, 15841, 16705, 19345, 22321, 30889, 41041, 46657, 50881, 52633, 71905, 75361, 88561, 93961, 115921, 126673, 162401, 172081, 193249, 247105, 334153, 340561, 378561, 449065, 460801, 574561, 656601, 658801, 670033, 930385

The 3-Lehmer numbers or numbers such that:$$\phi(n)|(n-1)^3$$are more numerous and in the range up to 40,000 there are 63 with 15 being the smallest. They are (permalink):

15, 85, 91, 133, 247, 259, 481, 703, 949, 1111, 1891, 2071, 2701, 2821, 3097, 3145, 3277, 4033, 4141, 4369, 4681, 5461, 5611, 5713, 6031, 7081, 7957, 8911, 9211, 9265, 10585, 11041, 11305, 12403, 13333, 13741, 13981, 14089, 14701, 14833, 15181, 16021, 16441, 16745, 17767, 18721, 22261, 23001, 24661, 25351, 26599, 27331, 29341, 31417, 31609, 31621, 34861, 35371, 35881, 36661, 37969, 38503, 39865

Numbers Aplenty has a table of the smallest numbers for values of \(k\) from 2 to 36. See Figure 1.


Figure 1

 Up to 40,000, the Lehmer numbers, for all values of \(k\) are:

15, 51, 85, 91, 133, 247, 255, 259, 435, 451, 481, 511, 561, 595, 679, 703, 763, 771, 949, 1105, 1111, 1141, 1261, 1285, 1351, 1387, 1417, 1615, 1695, 1729, 1843, 1891, 2047, 2071, 2091, 2119, 2431, 2465, 2509, 2701, 2761, 2821, 2955, 3031, 3097, 3145, 3277, 3367, 3409, 3589, 3655, 3667, 3855, 4033, 4039, 4141, 4369, 4411, 4681, 4795, 4921, 5083, 5151, 5383, 5461, 5551, 5611, 5629, 5713, 6031, 6205, 6331, 6601, 6643, 6735, 7051, 7081, 7141, 7471, 7501, 7735, 7957, 8071, 8119, 8227, 8245, 8401, 8481, 8695, 8827, 8911, 8995, 9061, 9079, 9139, 9211, 9253, 9265, 9367, 9605, 9709, 9919, 9997, 10213, 10291, 10573, 10585, 10795, 10963, 11041, 11155, 11305, 11899, 12403, 12801, 12901, 13021, 13107, 13333, 13651, 13741, 13747, 13855, 13981, 14089, 14491, 14497, 14611, 14701, 14833, 14911, 14989, 15051, 15181, 15211, 15811, 15841, 16021, 16297, 16405, 16441, 16471, 16531, 16705, 16745, 16771, 16861, 17563, 17611, 17733, 17767, 18019, 18031, 18151, 18631, 18721, 18745, 18907, 18967, 19345, 19669, 19951, 20419, 20451, 20595, 20995, 21037, 21349, 21679, 21845, 21907, 21931, 22015, 22261, 22321, 22359, 23001, 23281, 23959, 24199, 24415, 24643, 24661, 24727, 24871, 25123, 25141, 25351, 25669, 26281, 26335, 26467, 26599, 26923, 27223, 27331, 27511, 27721, 28231, 28453, 28645, 28939, 29341, 30481, 30583, 30889, 31171, 31417, 31459, 31609, 31611, 31621, 32215, 32407, 32551, 32691, 33001, 33709, 34441, 34861, 35113, 35371, 35551, 35881, 36091, 36391, 36499, 36661, 36751, 36805, 37231, 37921, 37969, 38165, 38503, 39091, 39403, 39491, 39817, 39831, 39865

Looking at this list, it can be seen that the Lehmer number previous to 26599 was 26467 while the next one is 26923. 26599 was my diurnal age yesterday and so it will more than a year before I see another one. One last point is that every Carmichael number is also a \(k\)-Lehmer number. This post is fairly superficial and I'm sure that a lot more can be said about Lehmer numbers but my purpose here is just to introduce them because I hadn't made a dedicated post about these numbers since beginning this blog.

There may be a link between pseudoprimes and Lehmer numbers that would be interesting to explore.

Saturday 29 January 2022

The T-square Fractal


Figure 1: source


Yesterday (when I was young) I came across the T-square fractal in the context of turning 26598 days old. Figure 1 shows a screenshot of my Twitter tweet for the day. The OEIS entry runs as follows:


 A227621

The nearest integer of perimeter of T-square (fractal) after n-iterations, starting with a unit square.


The initial members of the sequence are:
4, 8, 14, 23, 37, 57, 87, 133, 201, 304, 457, 688, 1034, 1553, 2331, 3499, 5251, 7878, 11819, 17731, 26598, 39899, 59851, 89778, 134669, 202005, 303010, 454517, 681778, 1022668, 1534004, 2301009, 3451515, 5177275, 7765914

Figure 2, taken from the Wikipedia entry, shows the initial steps in the creation of this fractal:


Figure 2: source

Figure 3 shows further details of the process:


Figure 3: source

Starting from an initial unit square, the fractal is bounded by the square with a side of two units since:$$ \sum_{n=0}^{\infty} \frac{1}{\,2^n}=2$$As the area of the fractal gets closer and closer to 2, the perimeter gets longer and longer. After 20 iterations, the perimeter is 26598 units in length. As this source explains:
The fractal dimension is the ratio between the "size" of the object and its "area". For example, a simple area has a fractal dimension of 2, which means that if you make it growth by \(x\), its area will be multiplied by \(x^2\). A fractal with a dimension of 1.5 will have its area multiplied by \(x^{1.5}\).

In the case of the T-Square, it has a dimension of 2 because its area nearly entirely fills the inner space within it. However, the dimension of its boundary is \( \frac{\log 3}{\log 2} \approx 1.58\).
OnlineMathTools enables the creation of a variety of fractals, including the T-square fractal, that can be customised in various ways. Figure 4 shows an example of such a fractal.


Figure 4: T-square fractal after 4 iterations

Thursday 27 January 2022

The Modest Magnetism of 26596

Today's diurnal number, 26596, has the interesting property that the sums of its odd and even digits are equal. Thus we see that 5 + 9 = 14 and 2 + 6 + 6 = 14. I've written extensively about the implications of this odd-even algorithm in the following posts:

Figure 1: ring magnet

I use the term attractor to describe numbers like 26596 that are unchanged by the odd-even algorithm. They act like magnets, attracting other numbers to them as these numbers are subjected to repeated applications of the algorithm. I've applied the term "modest magnetism" to 26596 because it attracts only 10 numbers while 26569, with exactly the same digits, manages to attract 92 numbers. These captured numbers I've termed, appropriately, captives.

The captives of 26596 and their trajectories are as follows:
  • 26579 --> [26579, 26592, 26596]
  • 26585 --> [26585, 26579, 26592, 26596]
  • 26590 --> [26590, 26596]
  • 26591 --> [26591, 26598, 26596]
  • 26592 --> [26592, 26596]
  • 26594 --> [26594, 26596]
  • 26598 --> [26598, 26596]
  • 26603 --> [26603, 26592, 26596]
  • 26605 --> [26605, 26596]
  • 26613 --> [26613, 26603, 26592, 26596]
Figure 2 shows the same information in a more pictorial way. It can be seen that some numbers are only one step removed (26590, 26592, 26594, 25598, 26605), others are two steps removed (26591, 26579, 26603) and others are three steps removed (26585, 26613):


Figure 2

There are 11 attractors in the range between 26500 and 26700, representing 5.5% of the total numbers in the range. These attractors are:
  • 26503 with no captives
  • 26525 with no captives
  • 26530 with 19 captives
  • 26547 with no captives
  • 26552 with 18 captives
  • 26569 with 92 captives
  • 26574 with no captives
  • 26596 with 10 captives
  • 26659 with no captives
  • 26677 with no captives
  • 26695 with no captives
It can be seen that seven of the attractors have no captives. They might be termed inert attractors. Clearly some centuries have more attractors than others. Between 26500 and 26600, there are eight attractors but between 26600 and 26700 there are only three (and all of them inert). Anyway, the above list provides a basis for comparison between 26596 and other attractors in a range of roughly 100 on either side of it.

For some time now, I've been keeping a daily check on what numbers are attractors and what numbers are captives of attractors. Figure 3 shows the trajectory for 26595, my diurnal age yesterday:


Figure 3

Interestingly tomorrow's number, 26597, forms part of a vortex together with 26610. This vortex manages to capture 13 numbers: 26599, 26611, 26612, 26614, 26616, 26617, 26618, 26623, 26625, 26627, 26633, 26637, 26639. As can be seen, some captives are not captured by attractors but by vortices like {26597, 26610}. This is all explained in my paper that I uploaded to Academia: link.

Saturday 22 January 2022

Folium of Descartes


René Descartes: 1596-1650

When I was searching for words ending in "-ium" for a Pedagogical Posturing blog that I came across the word "folium" and discovered its mathematical significance. To quote from Wikipedia:

In geometry, the folium of Descartes is an algebraic curve defined by the equation:$$x^{3}+y^{3}-3axy=0$$The name comes from the Latin word "folium" which means "leaf". The curve was first proposed and studied by René Descartes in 1638. Its claim to fame lies in an incident in the development of calculus. Descartes challenged Pierre de Fermat to find the tangent line to the curve at an arbitrary point since Fermat had recently discovered a method for finding tangent lines. Fermat solved the problem easily, something Descartes was unable to do. Since the invention of calculus, the slope of the tangent line can be found easily using implicit differentiation.


Pierre de Fermat: 1601-1665

Figure 1 depicts the shape of the graph when \(a=1\) as well as showing the line \(x+y+1=0\) which is asymptotic to it.


Figure 1: The folium of Descartes (green)
with asymptote (blue) when 

It is symmetrical about the line \(y=x\) and the two intersect at (0, 0) and (3\(a\)/2, 3\(a\)/2). The latter point is (1.5, 1,5) in Figure 1 where \(a\) has the value 1. When \(a=2\), the coordinates of point on the extremity of the loop takes on integer values viz. (3, 3). It's interesting to explore what values of \(a\) produce these points with integer values and how many there can be. Here is what I discovered:
  • when \(a\) is an odd prime, there are no such points
  • when \(a\) is composite, there is at least one such point
  • when there is only one point, it is always the point at the extremity of the loop
  • when there are an even number of points, none are at the extremity of the loop
  • when there are an odd number of points, one of them is at the extremity of the loop
Here are the records for number of points:
  • one point: \(a=2\) with point (3, 3)
  • two points: \(a=3\) with points: 
    • (2, 4), (4 ,2)
  • three points: \(a=6\) with points: 
    • (4, 8), (8,4), (9, 9)
  • four points: \(a=63\) with points: 
    • (42, 84), (80, 100), (84, 42), (100, 80)
  • five points: \(a=42\) with points: 
    • (5, 25), (25, 5), (28, 56), (56, 28), (63, 63)
  • six points: none found thus far
  • seven points: \(a=84\) with points: 
    • (10, 50), (27, 81), (50, 10), (56, 112), (81, 27), (112, 56), (126, 126)
  • eight points: none found thus far
  • nine points: \(a=252\) with points: 
    • (30, 150), (81, 243), (150, 30), (168, 336), (243, 81), (320, 400), (336, 168), (378, 378), (400, 320)
For values of \(a > 336\), the points occur only in pairs and increasingly sparsely. Figure 2 shows the situation for \(a=6\) where there are three pairs of integer coordinates.


Figure 2

Figure 3 shows the situation for \(a=42\) where there are five pairs of integer coordinates.


Figure 3

Some other interesting facts about the graph are:
  • the area of the interior of the loop is found to be \(3a^{2}/2\), so in:
    • Figure 1 the area is 1.5 square units
    • Figure 2 the area is 54 square units
    • Figure 3 the area is 2646 square units

  • the area between the "wings" of the curve and its slanted asymptote is also \(3a^{2}/2\)

  • Implicit differentiation gives the formula for the slope of the tangent line to this curve to be:$$ \frac{dy}{dx}=\frac{ay-x^2}{y^2-ax}$$
  • the graph has a parametric form of:$$x=\frac{3ap}{1+p^3} \text{ and } y=\frac{3ap^2}{1+p^3}$$
Click the following links for biographies of Descartes and Fermat.

Thursday 20 January 2022

Self Avoiding Walks

Today I turned 26590 old and one of the properties of this number is that its a member of OEIS A191823 where \(n=10\):


 A191823

Number of \(n\)-step three-sided prudent self-avoiding walks.                  

The initial members of the sequence are 1, 4, 12, 34, 90, 236, 612, 1580, 4060, 10404, 26590, 67820, 172654, 438842, ...

This set me off to find out what exactly what is meant by the terms used to describe members of this particular OEIS. Here is what I came up with (source):
  • A self-avoiding walk (SAW) is a sequence of moves on a lattice not visiting the same point more than once. See Figure 1.

    Figure 1: source

  • A SAW on the square lattice is prudent if it never takes a step towards a vertex it has already visited. See Figure 2 for an explanation of why the SAW in Figure 1 is not prudent.
Figure 2: this is NOT a prudent SAW
  • The box of a square lattice walk is the smallest rectangle that contains it. It is not hard to see that the endpoint of a prudent walk is always on the border of the box. This means that every new step either walks on the border of the box, of moves one of its four sides. Observe that a prudent walk is partially directed if its endpoint, as the walk grows, always lies on the top side of the box. This is why these walks are also called one-sided. See Figure 3
Figure 3: one-sided prudent SAW

Similarly, a prudent walk is two-sided if its endpoint, as the walk grows, lies always on the top or right side of the box. See Figure 4.
Figure 4: two-sided prudent SAW

It is three-sided if its endpoint, as the walk grows, is always on the top, right or left side of the box. See Figure 5. Of course, four-sided walks coincide with general prudent walks. See Figure 3 for examples of these. See Figure 6.
Figure 5: three-sided prudent SAW

Figure 6: four-sided prudent SAW

There is much research going into the study of these walks but I don't want to go into more detail here. I just wanted to get clear in my head what is a SAW, a PSAW and one-sided, two-sided, three-sided and four-sided PSAW.

Tuesday 18 January 2022

Pyramidal Numbers

Today I turned 26588 days old and one of the properties of this number is that it's a 15-gonal or pentadecagonal number and a member of OEIS A177890:


 A177890

15-gonal (or pentadecagonal) pyramidal numbers:                

a(\(n\)) = \( \dfrac{n (n+1)  (13n-10)}{6}\)


The initial members of the sequence are:
0, 1, 16, 58, 140, 275, 476, 756, 1128, 1605, 2200, 2926, 3796, 4823, 6020, 7400, 8976, 10761, 12768, 15010, 17500, 20251, 23276, 26588, 30200, 34125, 38376, 42966, 47908, 53215, 58900, 64976, 71456, 78353, 85680, 93450, 101676, 110371, 119548, 129220

GENERAL FORMULA

There is a general formula for \(P(n)\), the \(n\)-th polygonal pyramidal number, that uses \(T(n)\), the \(n\)-th triangular number, and \(s\) representing the number of sides of the polygon. Here it is:$$P(n,s)=T(n) \times \frac{(s-2) \times n - (s-5)}{3}$$In the case of 15-gonal numbers, the formula becomes:$$ \begin{align} P(n)&=T(n) \times \frac{13n - 10}{3}\\&=\frac{n(n+1)(13n-10)}{6} \text{ where }T(n)=\frac{n(n+1)}{2}\end{align}$$GENERATING FUNCTION

The generating function for pyramidal numbers is given by:$$G(x,s)=x \, \frac{(s-3)x+1}{(1-x)^4}$$In the case of the pentadecagonal numbers, this results in:$$G(x)=x \, \frac{12x+1}{(1-x)^4}$$PARTICULAR EXAMPLE

Figure 1 shows how a square pyramidal number is constructed:


Figure 1: source

Note that the 3-dimensional pyramidal numbers are constructed from 2-dimensional polygons stacked one on top of the other. In Figure 1, these polygons are squares. The sequence of square pyramidal numbers is given by:$$P_n^{^ {\,4}}=\frac{n(n+1)(2n+1)}{6}$$Figure 2 shows an actual pile of cannonballs forming a square-based pyramid.


Figure 2: source

On the topic of cannonballs, the cannonball problem can be stated as follows:

The cannonball problem asks for the sizes of pyramids of cannonballs that can also be spread out to form a square array, or equivalently, which numbers are both square and square pyramidal. Besides 1, there is only one other number that has this property: 4900, which is both the 70th square number and the 24th square pyramidal number. Source.

SUMS OF RECIPROCALS

The sums of the reciprocals of the pyramidal polygonal numbers all converge. Here are some examples:

  • triangular pyramidal: \( \displaystyle \sum_{n=1}^{\infty} \dfrac{6}{n(n+1)(n+2)}=\dfrac{3}{2} \)
  • square pyramidal: \( \displaystyle \sum_{n=1}^{\infty} \dfrac{6}{n(n+1)(2n+1)}=6(3-4 \log(2)) \)
  • pentagonal pyramidal: \( \displaystyle \sum_{n=1}^{\infty} \dfrac{6}{n^2(n+1)}=\dfrac{\pi^2}{3}-2 \)
More results are listed at this site. There is a rather formidable general formula for the sum of the reciprocals of the pyramidal numbers. I don't claim to understand it but here it is:$$ - \, \frac{6 [ s-5 +(s-2)(\psi ( \frac{3}{s-2} ) +\gamma)]}{(s-5)(2s-7)} $$where \( \psi(x) \) is the digamma function and \( \gamma \) is the  Euler-Mascheroni constant.

Alternating sums of reciprocals are also convergent. An example is the alternating sum of reciprocals of square pyramidal numbers where we have:$$6\sum_{n=1}^{\infty}  \dfrac{(-1)^{n-1}}{n(n+1)(2n+1)}=6(\pi-3)$$

Monday 17 January 2022

Tug of War

 Here is an interesting problem that I came across on this site:

  

The Robot Weightlifting World Championship was such a huge success that the organisers have hired you to help design its sequel: a Robot Tug-of-War Competition!

In each one-on-one matchup, two robots are tied together with a rope. The centre of the rope has a marker that begins above position 0 on the ground. The robots then alternate pulling on the rope. The first robot pulls in the positive direction towards 1; the second robot pulls in the negative direction towards -1. Each pull moves the marker a uniformly random draw from [0, 1] towards the pulling robot. If the marker first leaves the interval [‑½, ½] past ½, the first robot wins. If instead it first leaves the interval past -½, the second robot wins.

However, the organisers quickly noticed that the robot going second is at a disadvantage. They want to handicap the first robot by changing the initial position of the marker on the rope to be at some negative real number. Your job is to compute the position of the marker that makes each matchup a 50–50 competition between the robots. Find this position to seven significant digits-the integrity of the Robot Tug-of-War Competition hangs in the balance!

I managed to come up with the following program after experimentation with different starting values.


Figure 1: source

I found that a starting value of about -0.285 produced a 50-50 result on average, which is what the person who posed the problem found. See Figure 1. I don't know why an accuracy of seven significant figures was required and I certainly wasn't going to strive for that level of accuracy. In any case, my result was certainly close enough.

Generally the tug-of-war doesn't last long, only one or two randomisations. Figure 2 shows the results for an unusually lengthy match that ended in a win for Robot 1:


Figure 2: permalink

So far this post has been more about programming than mathematics but I was interested in how a number like 0.285 emerges from a problem like this. My result of -0.285 was purely empirical. It turns out that the solution is  the result of evaluating the following expression:$$ \arcsin \left (\frac{\sin(0.5)+\frac{\pi}{4}}{2} \right )-\frac{\pi}{4}$$Now that is interesting and the derivation of this result is explained on this site and reproduced below (where p stands for probability):

In order to find the starting position of the tug-of-war to make a fair fight, we define the function \(f\) on [-0.5, 0.5] as $$f(x) = \text{ p(Player 1 wins at a starting position of } x)$$The symmetry of the game implies $$ \begin{align} f(x) &= \text{ p(Player 1 wins on first move) } + \int_x^{½} \! \text{p(Player 2 wins at position }(-y)) \text{ d}y \\
&= (½ + x) + \int_x^{½}(1 - f(-y) ) \text{ d}y \end{align}$$Differentiating and applying the fundamental theorem of calculus, we get:

\( f’(x) = 1 - (1 - f(-x)) = f(-x)\)

Differentiating again and employing the chain rule, and then substituting the equation above, we get:

\( f’’(x) = f’(-x) \times (-1) = -f’(-x)= -f(x) \) 
 
The general solution to this differential equation is 
 
\(f(x) = A \sin(x) + B \cos(x) \)

We need two boundary conditions to determine \(f\) exactly. First, it’s clear we must have \(f(½) = 1\). Second, from the above formula, \(f’(0) = f(0)\). Therefore
$$ \begin{align} A \sin(½) + B \cos(½) &= 1 \text{ and}\\
A \cos(0)- B \sin(0) &= A \sin(0) + B \cos(0) \end{align}$$The second equation implies \(A = B\), and the first equation then gives:$$\begin{align}A &= B\\ &= \frac{ 1} {\sin(½) + \cos(½)} \text{ and so}\\ f(x) &= \frac {\sin(x) + \cos(x)}{\sin(½) + \cos(½)} \end{align}$$Therefore the answer is the solution to: $$ \frac{\sin(x) + \cos(x)}{\sin(½) + \cos(½)} = ½ \text{ on }[-½,0]$$ A calculator can give this to the desired accuracy, -0.2850001…, or by using $$\sin(x) + \cos(x) = \sqrt{2}· \sin(x + \pi/4)$$we can exactly solve that the answer is$$ \arcsin \left (\frac{\sin(0.5+\frac{\pi}{4}}{2} \right )-\frac{\pi}{4}$$I don't fully understand this explanation but I'm exhausted from fine tuning the LaTeX so I'll return to it later.

Thursday 13 January 2022

Another Look At Semiprimes

 I've written about semiprimes before, specifically in the following posts:


SEMIPRIME TRIPLETS

However, as with most mathematical topics, there's always more to discover. Today I turned \(26583\) days old and one of the properties of the number \(26583\) is that it's a member of OEIS A115393:


 A115393

Numbers \(n\) such that \(n\), \(n-1\) and \(n-2\) are semiprimes. 
                      

So we find that:
  • \(26583 = 3 \times 8861\)
  • \(26582  = 2 \times 13291\)
  • \(26581 = 19 \times 1399\)
    It's not possible to have four semiprimes in a row because every fourth number must be a multiple of \(4\). We see that here because:
    • \(26584 =2^3 \times 3323\)
    • \(26580 = 2^2 \times  3 \times  5 \times 443\)
    In the range from \(1\) up to \(26583\) there are \(139\) such triplets. The sequence begins:
    35, 87, 95, 123, 143, 203, 215, 219, 303, 395, 447, 635, 699, 843, 923, 1043, 1139, 1263, 1347, 1403, 1643, 1763, 1839, 1895, 1943, 1983, 2103, 2183, 2219, 2307, 2363, 2435, 2463, 2519, 2643, 2723, 2735, 3099, 3387, 3603, 3695, 3867, 3903, 3959, 4287

    The first triplet is thus:

    • \(33=3 \times 11\)
    • \(34=2 \times 17\)
    • \(35=5 \times 7\) 

    RECORD RUNS OF NUMBERS THAT ARE NOT SEMIPRIMES

    What about record runs of numbers that are not semiprimes? It turns out that \(6252893229398\) marks the start of a record-breaking run of \(173\) consecutive integers that ends with \(6252893229570\). The second case of a run of the same length is between \(9189221611478\) and \(9189221611650\). There are no greater runs less than \(10^{13}\). Source

    These numbers and their factorisations can be viewed by following this permalink. The semiprimes before and after the first record-breaking run are:
    • \(6252893229397 = 83537 \times 74851781\)
    • \(6252893229571 = 609607 \times 10257253\)
    For the second record-breaking run, the semiprimes before and after are:
    • \(9189221611477 = 877 \times 10478017801\)
    • \(9189221611651 = 197 \times 46645794983\)
    The numbers in between, together with their factorisations, can be viewed by following this permalink.

    THE ARECIBO MESSAGE


    Figure 1: This is a demonstration of the message with
    colour added to highlight its separate parts.
    The binary transmission sent carried no colour information.

    An interesting use of semiprimes is the Arecibo message involving the use of the semiprime \(1679\). See Figure 1.
    The number \(1679\) was chosen because it is a semiprime (the product of two prime numbers), to be arranged rectangularly as \(73\) rows by \(23\) columns. The alternative arrangement, \(23\) rows by \(73\) columns, produces an unintelligible set of characters.

    SEMIPRIME COUNTING FORMULA

    A semiprime counting formula was discovered by E. Noel and G. Panos in 2005. Source: On distribution of semiprime numbers: Shamil Ishmukhametov.

    Let \( \pi_2 (n) \) denote the number of semiprimes less than or equal to \(n\).  Then$$ \pi_2 (n) = \sum_{k=1}^{\pi (\sqrt n) } [ \pi(n/p_k) - k + 1 ]$$where \( \pi(x) \) is the prime-counting function and \(p_k\) denotes the \(k\)th prime. Source: Semiprime from Wolfram MathWorld.

    This formula does return, correctly, the result that 26583 is the 6648th semiprime (permalink).

    Saturday 8 January 2022

    Mathematical Quiz: 1

    This post is just a first attempt at creating a mathematical quiz. I'm still thinking about the best way to present such a quiz from the wide variety of online resources available. The target audience is an important consideration. The first seven questions of this particular quiz is accessible to those you have completed a course in high school mathematics. The last three questions however, would not be but would serve to stimulate interest and get them to follow the suggested links. This whole quiz concept is a work in progress so I'll keep experimenting with quiz content and design.

    Here is a set of ten mathematical questions that will test your understanding of Mathematics and perhaps help you to learn things of interest in the process. You should not use a calculator (except for Question 6) or reference material to answer these questions. Just rely on your own resources.

    Questions:
    1. Evaluate \(2^{3^2}\)

    2. \(\pi\) represents the ratio of a circle's diameter to its circumference while \(e\) is the base of the natural logarithms. What is the product of these two numbers?

    3. Evaluate \( \dfrac{1}{0!}\)

    4. Evaluate \(4 + 8 \div 4 \times 2\)

    5. Will \(2100\) be a leap year?

    6. In a random group of people, how many are needed so that the probability of two people sharing the same birthday is about 50%? You can use a calculator for this problem.

    7. Can you find the smallest integer that can be written as \(x^2+xy+y^2 \) in two different ways with \(x \geq 0\) and \(y \geq 0\)? Hint: it's smaller than 50.

    8. A happy number is one that reduces to 1 with repeated sums of squares of digits. For example, \(13 \rightarrow 1^2+3^2 = 10 \rightarrow 1^2+0^2 = 1\). What happens to numbers that aren't happy?

    9. \(5=2^2+1^2\) but \(7\) can't be written as a sum of two squares. Using this information, try to decide whether the prime number \(1009\) can or cannot be written as a sum of two squares. Hint: use modular arithmetic. 

    10. Who is this German mathematician depicted below? Hint: his first name is Georg. He was born in 1845 and died in 1918.

    Answers:

    1.  The rule is that the calculation proceeds from the top downwards and so we calculate \(3^2=9 \) first, then \(2^9=512\). Proceeding from the bottom up, we would evaluate \(2^3=8\) and then \(8^2=64\) but this is incorrect. Thus the answer is 512.

      Comment: I've written about this in a blog post titled Power Towers and Tetration. This is a simple but important principle to understand and is a sort of extension of the BOMDAS rule (Brackets, Of, Multiplication, Division, Addition, Subtraction).

    2. This is definitely a trick question. The answer is \(pie\).

      Comment: there's always room for humour in mathematics, provided it's not overdone. 

    3. It needs to be remembered that \(0!=1\) and thus the answer is 1.

      Comment: many former high school students would remember that zero factorial is 1 so this is not as difficult as it looks.

    4. To prevent mistakes put a bracket around division and multiplication before proceeding from left to right. This gives:

      \(4 + ((8 \div 4 )\times 2)=4 + (2 \times 2)=4+4=8\)

      Comment: this will trick a lot of people but it's still an elementary problem that even an upper level primary student should be able to handle.

    5. End of century years must be divisible by \(4\) and \(100\). While \(2100\) is divisible by \(100\), it is not divisible by \(4\) and thus it is not a leap year.

      Comment: this is not widely known but it should be and so this problem will inform those who weren't familiar with the rule.

    6. This is the famous birthday problem and the answer is 23 people. I've written about this is a blog post titled 23.

      Comment: the number is somewhat counter-intuitive in that it's much smaller than one might expect. It's an interesting problem that doesn't require any high level mathematics but will require a calculator (hence the exemption).

      Here is a brief explanation taken from my previously mentioned blog post:
      • With 23 people we have 253 pairs: \(\dfrac{23 \times 22}{2}=253\)
      • The chance of two people having different birthdays is \(1−\dfrac{1}{365}=\dfrac{364}{365}=0.997260\)
      • Makes sense, right? When comparing one person's birthday to another, in 364 out of 365 scenarios they won't match. Fine. But making 253 comparisons and having them all be different is like getting heads 253 times in a row - you had to dodge "tails" each time. Let's get an approximate solution by pretending birthday comparisons are like coin flips.We use exponents to find the probability:
        • \( \left (\dfrac{364}{365} \right )^{253}=0.4995 \approx 50 \%\)
      • Our chance of getting a single miss is pretty high (99.7260%), but when you take that chance hundreds of times, the odds of keeping up that streak drop. Fast.

    7. The smallest integer is \(49=0^2+0 \times 7+7^2=3^2+3 \times 5+5^2\). Such numbers are called Loeschian numbers and I've written about them in this post.

      Comment: this is easy to work out with a little trial and error.

    8. It shouldn't take too long for someone to realise that numbers that aren't happy end up in the loop {4,16,37,58,89,145,42,20}. I've written about these in a post titled Happy Numbers.

      Comment: the discovery takes just a little trial and error.

    9. All primes of the form \(4k+1\) where \(k \geq 1\) can be written as a sum of two squares. Now \(1009 \div 4\) leaves a remainder of \(1\) so it is of the form \(4k+1\) and can be written as a sum of two squares (\(15^2+28^2\)). I've written about these in a post titled Sum of Two Squares

      Comment: this is a little difficult but the hint to use modular arithmetic should nudge people in the right direction.

    10. His name is Georg Cantor and he is the "father" of set theory. You can read more about him by following this link.

      Comment: the first name is "Georg" and other hints will eliminate the well-known mathematics so some people may guess this because "Cantor" is reasonably well-known.
    Since creating this quiz I've modified and improved the questions in various ways, so it's been a useful exercise. I still have to decide on the best way to present them. I may experiment with various formats and report back on this post as I'll use this quiz as the content.

    ADDENDUM:

    I've made use of QUIZIZZ to create a multiple choice quiz using 9 out of the 10 questions. Question 2 wasn't suitable for multiple choice so I've replaced it with another one involving identification of primes. A negative is that the site requires the setting up of a class and the addition of the quiz to that class as homework. Anyone wanting to take the test needs to set up an account by visiting https://quizizz.com/join/class and then use the class code which is M214707.


    There are other negatives. As far as I can tell there is no support for LaTeX and so any mathematical expressions have to be included as images. However, the images are easily imported and display well so it's not a major issue. Any revisions mean that the image must be deleted and a new one imported.

    Wednesday 5 January 2022

    Loeschian Numbers

    Loeschian numbers are numbers of the form \(x^2+xy+y^2\) where \(x\) and \(y\) are integers. I came across these today when looking for interesting properties associated with my diurnal age of 26575 days. The Wikipedia article states that:
    They are a set of whole numbers, including zero, and having prime factorisation in which all primes congruent to 2 mod 3 have even powers (there is no restriction of primes congruent to 0 or 1 mod 3).

    Now \(26575 =5^2 \times 1063\) and we see that \(5 \equiv 2 \hspace{-4pt} \mod{3}\) is raised to an even power while \(1063 \equiv 1 \hspace{-4pt} \mod{3}\). These numbers are relatively frequent. For example of the first 1000 integers, 277 (or 27.7%) of them are Loeschian. Some have only one representation such as \(26575 = 15^2+15 \times 155+155^2\) while others have more than one. For example:$$ \begin{align} 637 &=4^2+4 \times 23+ 23^2\\ &=7^2+7 \times 21+21^2 \\ &=12^2+12 \times 17+ 17^2 \\931&=1^2+1 \times 30+ 30^2 \\&=14^2+14 \times 21+21^2\\ &=9^2+ 9 \times 25+25^2 \end{align}$$It was in this context that the famous taxi cab number 1729 popped up again. I've written about this number before in a post titled The Original Taxi Cab Number in a New Light on December 21st 2019. In that post, I listed several of its properties but not the fact that it is a member of OEIS A198775:


     A198775

    Numbers having exactly four representations by the quadratic form \(x^2+xy+y^2\) with \(0 \leq x \leq y\).


    We find that the first member of this sequence is 1729:
    1729, 2821, 3367, 3913, 4123, 4459, 4921, 5187, 5551, 5719, 6097, 6517, 6643, 6916, 7189, 7657, 8029, 8113, 8463, 8827, 8911, 9139, 9331, 9373, 9709, 9919, 10101, 10507, 10621, 10633, 11137, 11284, 11557, 11739, 12369, 12649, 12691, 12901, 13237, 13377, ...

    It has the following representations:$$ \begin{align} 1729 &= 23^2 +23 \times 25+25^2  \\&=3^2+3 \times 40+40^2  \\ &=15^2+15 \times 32+32^2 \\  &=8^2+ 8 \times 37+37^2 \end{align}$$

    The Loeschian numbers are named after August Lösch whose Wikipedia entry remarks:

    Overall, Lösch made a plenitude of significant findings in the world of economics, but his main contributions were to regional economics, specifically, pioneering the location theory, spatial equilibrium analysis and hierarchical spatial systems displaying a hexagonal pattern.

    Figure 1 shows the triangular or, when combined into groups of six, the hexagonal lattice formed by the Eisenstein integers which Lösch must have used in his economic analysis. 


    Figure 1

    It turns out the Loeschian numbers are the norms of the Eisenstein integers. In mathematics, Eisenstein integers (named after Gotthold Eisenstein), occasionally also known as Eulerian integers (after Leonhard Euler), are complex numbers of the form:$$ \begin{align} z &= x + y\omega \text{ where }x \text{ and } y \text{ are integers }\\ \text{ and where }\omega &= \frac{-1 + i \hspace{2pt} \sqrt{3}}{2} = e^{i\frac{2\pi}{^3}} \end{align}$$ The 2-norm of an Eisenstein integer is just its squared modulus, and is given by:$$ \begin{align} \left|x + y\;\!\omega\right|^2 \,&= \, (x - \tfrac{1}{2} y)^2 + \tfrac{3}{4} y^2 \, \\ &= \, x^2 - xy + y^2 \end{align} $$It can be seen that we have a \(-xy\) instead of a \(+xy\) term but then again \(x\) and \(y\) are no longer restricted to being positive. For example, if we allow \(x\) and \(y\) to be negative as well as positive, then 26575 can be written as:$$ \begin{align} 26575 &=15^2+15 \times 155+155^2 \\ &=155^2-155 \times 170+170^2 \end{align}$$So that will do it for now but there is clearly much more that could be said about Loeschian numbers. More at a later date.