Showing posts with label mean. Show all posts
Showing posts with label mean. Show all posts

Wednesday, 8 April 2026

Average of Three Primes Squared

The number associated with my diurnal age today is 28129 and it is a member of OEIS A075893:


     A075893: average of three successive primes squared with \(n > 3\) 
   
             
    \( \dfrac{\text{prime} (n)^2+ \text{prime}(n+1)^2+\text{prime}(n+2)^2)}{3}\)

The initial terms are:

65, 113, 193, 273, 393, 577, 777, 1057, 1337, 1633, 1913, 2289, 2833, 3337, 3897, 4417, 4953, 5537, 6153, 7017, 8073, 9177, 10073, 10753, 11313, 12033, 13593, 15353, 17353, 18417, 20097, 21441, 23217, 24673, 26369, 28129, 29953, 31577, 33761, 35497, 37513, 38553

The OEIS comments state that:

Unlike the average of three successive primes, the average of three successive primes (greater than 3) squared is always integral.

I asked Gemini why this was so:

The reason the average of the squares of three successive primes (greater than 3) is always an integer is based on a fascinating pattern about how primes behave when divided by 3.

In fact, this rule doesn't just apply to successive primes—it applies to any three primes greater than 3. Here is the step-by-step mathematical breakdown of why this happens.

1. All Primes Greater Than 3 Avoid Multiples of 3

By definition, a prime number is only divisible by 1 and itself. This means that any prime number strictly greater than 3 cannot be a multiple of 3.

If we divide any number by 3, we can only ever get one of three possible remainders: 0, 1, or 2.

  • Because primes greater than 3 are not divisible by 3, they will never have a remainder of 0.
  • Therefore, any prime number p > 3 must leave a remainder of either 1 or 2 when divided by 3.

In algebra, this means every prime p > 3 can be written in one of two ways, where k is an integer:

  • p = 3k + 1 (leaves a remainder of 1)
  • p = 3k + 2 (leaves a remainder of 2, which can also be written as p = 3k - 1)

2. Squaring the Primes

Now, let's look at what happens when we square these prime numbers.

Case A: The prime is 3k + 1
p2 = (3k + 1)2
p2 = 9k2 + 6k + 1

We can factor out a 3 from the first two terms:
p2 = 3(3k2 + 2k) + 1

Because 3(3k2 + 2k) is a multiple of 3, the entire expression leaves a remainder of 1 when divided by 3.

Case B: The prime is 3k - 1
p2 = (3k - 1)2
p2 = 9k2 - 6k + 1

Again, factor out a 3 from the first two terms:
p2 = 3(3k2 - 2k) + 1

Just like the first case, this leaves a remainder of 1 when divided by 3.

The Key Rule: No matter which type of prime you have, as long as it is greater than 3, its square will always be exactly 1 more than a multiple of 3.

3. Averaging Three Squared Primes

Let p1, p2, and p3 be any three primes greater than 3. Based on our rule above, we can express their squares as:

  • p12 = 3a + 1
  • p22 = 3b + 1
  • p32 = 3c + 1

Now, add them together to find the sum:
Sum = (3a + 1) + (3b + 1) + (3c + 1)
Sum = 3a + 3b + 3c + 3

We can factor out a 3 from the entire sum:
Sum = 3(a + b + c + 1)

Since the sum of the three squared primes is a perfect multiple of 3, dividing that sum by 3 to find the average will always result in a clean integer:
Average = 3(a + b + c + 1) / 3 = a + b + c + 1

Because a, b, and c are integers, the average itself is guaranteed to be an integer.

Monday, 26 January 2026

A Little Maths Puzzle


This puzzle appeared on PUZZLE A DAY and asks:

What is the only positive number that is equal to the average of its digits? Trailing zeros are not permitted. The trivial single digit answers don’t count as the question specifies ‘digits’. The clue provided is that the number consists of two digits. 

I made the mistake of thinking that the number is a two digit integer and reached an impasse. Let's represent the number with the digits \(x\) and \(y\). Then we have:$$ \begin{align} 10x + y &=\frac{x+y}{2} \\ 20x + 2y &=x+y \\ 19x + y &= 0 \end{align}$$Clearly this yields no solutions. However. Let's try the number \(x.y\) where the dot represents the decimal place. Then we have:$$ \begin{align} x + \frac{y}{10} &= \frac{x+y}{2} \\10x+y &= 5x+ 5y \\5x-4y &= 0 \end{align}$$This does yield a solution when \(x=4\) and \(y=5\). So the number must be 4.5 which indeed is the average of 4 and 5.

It's just a simple little problem but once you lock into that mindset that the number is an integer a solution seems impossible. I asked Gemini if there are positive numbers that satisfy for the geometric and harmonic means and the short answer is NO. 

Wednesday, 6 August 2025

Wordle Statistics Update

Here are my latest Wordle statistics as of August 6th 2025:


It turns out that I've lost 25 games out of the total of 908 games that I've played. This corresponds to a win rate of 97.25% which Wordle has rounded down to the 97% shown above. My average is \( \textbf{3.94} \) guesses which is a slight increase from the \( \textbf{3.92} \) guesses recorded on the 7th October 2024. Is this a sign of mental decline or is Wordle getting slightly more difficult?

What has changed significantly however, is my win rate. On the previous date it was 98.25%. I had lost only 11 games out of the 629 games that I'd played. Since then I've lost another 14 games which has seriously impacted my win rate. I put the following question to Gemini:
Are there any statistics to support the fact that Wordle, the online word game, is getting more difficult over the past year or more. I'm interested because my win rate in the game has dropped from 98.25% to 97.25% over the past year. Am I getting worse or is Wordle getting harder. I'd be curious to know.

This is an excellent question that gets to the heart of a common Wordle player's frustration. The short answer is: yes, there's evidence to suggest that the game is, in fact, getting harder. Your experience is not just a personal feeling; it's a trend that has been observed and analyzed.

While The New York Times, which acquired Wordle, has stated that they haven't intentionally made the game more difficult, and even removed some more obscure words, the inherent structure of the game's pre-determined word list is the likely culprit.

Here's a breakdown of the statistical and logical reasons why Wordle is getting harder:

1. The Finite and Ordered Word List

The game's original creator, Josh Wardle, established a list of about 2,300 possible solution words. These were likely curated with common words appearing earlier in the list and more obscure or challenging words appearing later. As the game progresses through this list, the words naturally become less common, contain more unusual letter combinations, or have tricky repeating letters.

2. "Confusability" of Words

A major factor in a Wordle puzzle's difficulty is its "confusability"—that is, how many other valid five-letter words share a similar letter pattern. As the game's word list gets further in, there are more words that fit this profile. For example, a word ending in "-OUND" could be "FOUND," "MOUND," "ROUND," "POUND," etc. As you get hints, you might narrow it down to the correct letters but be left with several possibilities for your last few guesses, making a loss more likely. Words with repeated letters, like "MOMMY" or "CORER," also fall into this category and have a higher failure rate.

3. Data from WordleBot and Player Averages

The New York Times' own tool, WordleBot, analyzes player data for each puzzle, including the average number of guesses and the solve rate. This data has shown that certain words are consistently more difficult for players. For instance, an analysis of the "10 most difficult Wordles of 2024" showed words like "HUNCH," "FIBER," and "PIPER" had high average guess counts and low solve rates. These difficult words, with their repeated letters and multiple possible solutions, are appearing more frequently as the game's long-term list is exhausted. One report even noted that a recent month was "officially Wordle's toughest month ever," with an average score of 4.22, significantly higher than the game's overall average of around 3.97.

What This Means for You

Your win rate dropping from 98.25% to 97.25% is a very small, statistically normal change over a year, but it aligns with the overall trend of the game getting slightly more difficult. It's highly unlikely that you are "getting worse" at the game; rather, the game's inherent difficulty is increasing. The words are becoming less common and are more likely to have the characteristics that make a puzzle a "streak-breaker." 

Sunday, 26 January 2025

Odd and Even Digit Averages

What do the following 98 numbers have in common (permalink)?

102, 123, 147, 234, 258, 306, 345, 369, 456, 567, 678, 789, 1012, 1034, 1056, 1078, 1223, 1245, 1267, 1289, 1447, 1469, 2334, 2356, 2378, 2558, 3036, 3058, 3445, 3467, 3489, 3669, 4556, 4578, 5667, 5689, 6778, 7889, 10004, 10022, 10036, 10112, 10167, 10234, 10356, 10478, 10667, 11125, 11233, 11247, 11459, 11477, 12223, 12278, 12345, 12467, 12589, 12778, 13349, 13457, 14447, 14555, 14569, 14677, 15699, 16779, 20238, 20346, 22236, 22344, 22358, 22588, 23334, 23389, 23456, 23578, 23889, 24568, 25558, 25666, 25788, 30048, 30066, 30336, 30444, 30458, 30566, 33347, 33455, 33469, 33699, 34445, 34567, 34689, 35679, 36669, 36777, 36899

First and foremost, all the numbers have their digits arranged in ascending order. Apart from that however, what else do they have in common? Let's look at the largest member of the sequence: 36899. It has odd digits of 3, 9, 9 and even digits of 6, 8. What are the averages of the odd and even digits? Well, (3 + 9 + 9)/3 = 7 and (6 + 8)/3 = 7 and so the average of the odd and even digits is the same. This is true of all the numbers. The reason that the digits have been arranged in ascending order is that these might be called "root" numbers because any number that is a permutation of the digits of the one of these numbers will have the property that its average of odd and even digits is the same.

In the range up to 40000, there are 1886 numbers that satisfy this equal average criterion. This comprises 4.71% of the range. Here is a permalink that will display these numbers. If we want to apply additional criteria, then this total of 1886 can be reduced significantly. For example, let’s require that the numbers be prime as well as the average of odd and even digits. The first such number would be 1223 which is prime and where the odd average is (1 + 3)/2 = 2 and the even average is (2 + 2)/2 = 2. There are 97 such numbers in the range up to 40000 (permalink):

1223, 1289, 2213, 2819, 2837, 3041, 3221, 3467, 4013, 4637, 4673, 4691, 5689, 5869, 6473, 6491, 7283, 7643, 7687, 7823, 7867, 8219, 8237, 8273, 8291, 8677, 9281, 9461, 10243, 11251, 12043, 12511, 12589, 14767, 15121, 15289, 15649, 16477, 16747, 17467, 17827, 20143, 20341, 20431, 21313, 21589, 21787, 21859, 22123, 23041, 23131, 23311, 23857, 23893, 24103, 25111, 25189, 25819, 25873, 25981, 27583, 27817, 28393, 28537, 28573, 28591, 28753, 28771, 28933, 29383, 29581, 29833, 29851, 30241, 31123, 31231, 31321, 32401, 32587, 32839, 32983, 33211, 33289, 33469, 33829, 34369, 34693, 34963, 36457, 36493, 36899, 36943, 38239, 38329, 38699, 38923, 39869

Neither of these two sequences is registered in the OEIS and I certainly won't be proposing them to the cretins who oversee it. However, the sequences are in my own private database. Here is the link. The averages themselves do not need to be integers. For example 3863503 has an odd average of (3 + 3 + 5 + 3)/3 = 14/3 and an even average of (8 + 6 + 0)/3 = 14/3. However, for all numbers in the range up to 40000, the averages are all integers.

Of course, we need not consider odd and even digits. We could consider the average of prime (2, 3, 5 and 7) and non-prime (0, 1, 4, 6, 8, 9) digits. An example of a number in which the average of the prime and non-prime digits is the same would be 39760 where (3 + 7)/2 = 5 and (9 + 6 + 0)/3 = 5. Here is a permalink to generate these numbers.

Monday, 7 October 2024

My Wordle Statistics

Figure 1 shows a screenshot of my Wordle statistics as of the 6th October 2024, a day on which I turned 75.5 years old.


Figure 1

Even though I've played 629 games, I lost 11 of them because I didn't guess the correct word in six tries or under. In order to accurately assess my average score, these losses need to be taken into account. To do that, I think the best approach is to add the number 7 to the guess distribution and include the 11 losses there. This then gives the following (number, frequency) distribution:$$(\textbf{1},0), (\textbf{2},38),(\textbf{3},196),(\textbf{4},234),(\textbf{5},113),(\textbf{6},37),(\textbf{7},11)$$The arithmetic mean can then be calculated using the formula:$$ \begin{align} \text{mean} &= \frac{\text{total of number} \times \text{frequency}}{\text{frequency total}}\\ &= \frac{2464}{629}\\ &\approx 3.92 \end{align} $$So there we have it. My average is slightly under 4 tries in successfully guessing the correct word. Google's Gemini confirms that the introduction of the 7 is the best way to calculate the average. How do I compare with the rest of the world? Well, there is an interesting site that lists statistics regarding Wordle results worldwide. Figure 2 shows a world map. 


Figure 2: data as of 22nd August 2023

Canberra, Australia, is the global city with the best Wordle average: 3.58 guesses. Sweden is the world’s best country at Wordle, with an average of 3.72. The source used to obtain this data was tweets on Twitter or X as it's now called. Clearly this introduces a huge bias because only people who are keen Wordle players will bother tweeting about their Wordle expertise and there will be a decided bias toward posting impressive success rather than bare wins (six guesses) or losses (failing to identify the word within six guesses). There's also the possibility of straight out cheating.

There's also hard mode and default mode. On every turn in the former you must use all the letters guessed on the previous turn. I haven't set Wordle to hard mode but I always play that way, although occassionally I'll slip up and forget to use a letter that I've already guessed. There's an online site that will generate your average once you input your data. Based on data input to this site, the statistics shown in Figure 3 seem more believable:

Figure 3: source

Once again however, only very dedicated players will be using this site but at least it shows that my average is higher than the national average for Australia. There is a site that lists the results for each day's Wordle and this site is based on actual attempts made that day to the Wordle site. See Figure 4.

Figure 4: source

These results most accurately depict the correct state of affairs I think. I've posted previously about Wordle: Wordle Statistics on 7th of February 2022 and More Wordle Statistics on 8th of February 2022.

Monday, 1 January 2024

Unitary Harmonic Numbers

As I'm creating this post it is the first day of 2024 but on the last day of 2023, I came across the term Unitary Harmonic Number for the first time. This is not surprising as they are quite rare. The initial numbers, up to 40000, are 1, 6, 45, 60, 90, 420, 630, 1512, 3780, 5460, 7560, 8190, 9100, 15925, 16632, 27300 and 31500. Yesterday, my diurnal age was 27300 which is why the term came to my attention.

A unitary harmonic number is defined as a number whose unitary divisors have a harmonic mean that is an integer. This is clearly not often the case. Let's take the number 12. It has divisors of 1, 2, 3, 4, 6 and 12. Of these, only 1, 3, 4 and 12 are unitary divisors. Let's recall that a unitary divisor of a number is a divisor such that, when divided into the number, the result is a number that has no factors in common with the divisor. For example, 2 divides into 12 to give 6 but 6 and 2 have 2 as a common factor and so 2 is not a unitary divisor. 3 however divides into 12 to give 4. 3 and 4 have no common factor and so 3 is a unitary divisor. 

Let's look at 27300. It has the following divisors:

1, 2, 3, 4, 5, 6, 7, 10, 12, 13, 14, 15, 20, 21, 25, 26, 28, 30, 35, 39, 42, 50, 52, 60, 65, 70, 75, 78, 84, 91, 100, 105, 130, 140, 150, 156, 175, 182, 195, 210, 260, 273, 300, 325, 350, 364, 390, 420, 455, 525, 546, 650, 700, 780, 910, 975, 1050, 1092, 1300, 1365, 1820, 1950, 2100, 2275, 2730, 3900, 4550, 5460, 6825, 9100, 13650, 27300

There are 32 unitary divisors of 27300 and they are:

1, 3, 4, 7, 12, 13, 21, 25, 28, 39, 52, 75, 84, 91, 100, 156, 175, 273, 300, 325, 364, 525, 700, 975, 1092, 1300, 2100, 2275, 3900, 6825, 9100, 27300

The harmonic mean of a set of numbers is defined as the reciprocal of the average of the reciprocals of the numbers. The sum of the 32 reciprocals of the unitary divisors is 32/15 and thus their average is 1/15 which becomes 15 when we consider the reciprocal. Numbers like 27300 comprise OEIS A006086 (permalink):


 A006086

Unitary harmonic numbers (those for which the unitary harmonic mean is an integer).



The next unitary harmonic number will occur when I'm 31500 days old which I may or may not be around to celebrate. For posts relating to the harmonic mean see Reciprocals of Primes and Root-Mean-Square And Other Means.

Sunday, 29 January 2023

Iteration: Reverse and Add Sum of Digits

My previous post, titled Iteration: Reverse and Subtract Maximum Digit, encouraged me to look at some variants on this theme. I discovered that Reverse and Add Sum of Digits is interesting. In the range up to 100,000, this iteration always produces a loop. The trajectory of maximum length is achieved by 84761 with a length of 126. Here is the trajectory:

84761, 16774, 47786, 68806, 60914, 41926, 62936, 63952, 25961, 16975, 57989, 99013, 31121, 12121, 12128, 82135, 53147, 74155, 55169, 96181, 18194, 49204, 40313, 31315, 51326, 62332, 23342, 24346, 64361, 16366, 66383, 38392, 29408, 80515, 51527, 72535, 53549, 94561, 16574, 47584, 48602, 20704, 40715, 51721, 12731, 13735, 53750, 5755, 5597, 7981, 1922, 2305, 5042, 2416, 6155, 5533, 3371, 1747, 7490, 967, 791, 214, 419, 928, 848, 868, 890, 115, 518, 829, 947, 769, 989, 1015, 5108, 8029, 9227, 7249, 9449, 9475, 5774, 4798, 9002, 2020, 206, 610, 23, 37, 83, 49, 107, 709, 923, 343, 353, 364, 476, 691, 212, 217, 722, 238, 845, 565, 581, 199, 1010, 103, 305, 511, 122, 226, 632, 247, 755, 574, 491, 208, 812, 229, 935, 556, 671, 190, 101, 103

Figure 1 shows a graph of the trajectory.


Figure 1: permalink

Figure 2 shows the same graph by with a logarithmic scale for the y axis.


Figure 2: permalink

Figure 3 shows a plot of the trajectory lengths for the first 100,000 numbers.


Figure 3: permalink

The average trajectory length is a little of over 43. As the numbers get bigger, it's not surprising that the trajectory lengths grow larger. For example, take the set of numbers corresponding to the dates in 2023 (see Turning Dates Into Numbers). For this set of numbers, the average trajectory length is a little over 72 and the record is achieved by 20230518 (corresponding to 18th May 2023) with a trajectory length of 162:

20230518, 81503223, 32230542, 24503244, 44230566, 66503274, 47230599, 99503313, 31330632, 23603334, 43330656, 65603364, 46330689, 98603403, 30430722, 22703424, 42430746, 64703454, 45430779, 97703493, 39430821, 12803523, 32530845, 54803553, 35530878, 87803592, 29530920, 2903622, 2263116, 6113643, 3463140, 413664, 466338, 833694, 496371, 173724, 427395, 593754, 457428, 824784, 487461, 164814, 418485, 584844, 448518, 815874, 478551, 155904, 409575, 575934, 439608, 806964, 469641, 146994, 499674, 477033, 330798, 897063, 360831, 138084, 480855, 558114, 411879, 978144, 441912, 219165, 561936, 639195, 591969, 969234, 433002, 200346, 643017, 710367, 763041, 140388, 883065, 560418, 814089, 980448, 844122, 221469, 964146, 641499, 994179, 971538, 835212, 212559, 955236, 632589, 985269, 962628, 826302, 203649, 946326, 623679, 976359, 953718, 817392, 293748, 847425, 524778, 877458, 854817, 718491, 194847, 748524, 425877, 778557, 755916, 619590, 95946, 64992, 29976, 68025, 52107, 70140, 4119, 9129, 9240, 444, 456, 669, 987, 813, 330, 39, 105, 507, 717, 732, 249, 957, 780, 102, 204, 408, 816, 633, 348, 858, 879, 1002, 2004, 4008, 8016, 6123, 3228, 8238, 8349, 9462, 2670, 777, 798, 921, 141, 147, 753, 372, 285, 597, 816

Figure 4 shows a graph of this trajectory:


Figure 4: permalink

Figure 5 shows the same trajectory but uses a logarithmic scale for the y axis:


Figure 5: permalink

I suspect that a loop is eventually reached for any number, no matter how large. However, I can't prove this but a proof may be possible. This iteration that I've just examined is just another of many possible iterations and I may investigate others at a future date.

Saturday, 12 September 2020

Root-Mean-Square And Other Means

Today I turned 26095 days old and this number happens to be a so-called RMS number where RMS stands for Root-Mean-Square. Such numbers are defined by OEIS A140480 as numbers \(n\) such that root mean square of divisors of \(n\) is an integer. Now the root mean square of divisors is defined by MathWorld as:

For a set of \(n\) numbers or values of a discrete distribution \(x_i, ..., x_n\), the root-mean-square (abbreviated "RMS" and sometimes called the quadratic mean), is the square root of mean of the values \(x_i^2\), namely:$$x_{RMS}=\sqrt{\frac{x_1^2+x_2^2+...+x_n^2}{n}}=\sqrt{\dfrac{\sum \limits_{i=1}^n x_i^2}{n}}$$For a variate \(\chi\) from a continuous distribution \(P(x)\), we have:$$x_{RMS}=\sqrt{ \frac{\int[P(x)]^2 dx}{\int P(x) \,dx}}$$where the integrals are taken over the domain of the distribution. Similarly, for a function \(f(t)\) periodic over the interval \([T_1,T_2]\), the root-mean-square is defined as:$$f_{RMS}=\sqrt{\frac{1}{T_2-T_1}\int_{T_1}^{T_2} [f(t)]^2 dt}$$

The sequence to which 26095 belongs runs 1, 7, 41, 239, 287, 1673, 3055, 6665, 9545, 9799, 9855, 21385, 26095, ... with 7, 41 and 239 being prime and the next prime being 9369319. Such primes are known as NSW primes, after Newman, Shanks, and Williams (the authors of a paper on the subject back in 1981). If we designate \(n\) to be such a prime number, then \(n\) has 2 divisors \([1, n]\) and we have to solve Pell's equation \(n^2 = 2*C^2 - 1\) where \(C\) is a positive integer. The solution is a prime \(n\) of the form \(u_i = 6u_{i-1} - u_{i-2} \), where \(i \geq 2, u_0=1, u_1=7\). These primes are listed in OEIS A088165.

There are of course many other types of means including arithmetic, geometric, harmonic, Pythagorean, power, Heronian, Identric, population, Chisini, Stolarsky, Lehmer, weighted and so on. The arithmetic mean is certainly the best known and most widely used but the root-mean-square has many applications in scientific circles. I've encountered the root-mean-square before in the context of the root-mean-square-error (see Figure 1).


Figure 1

A regression line is a line drawn such that the RMSE is minimised (see Figure 2).

Figure 2

The root-mean-square is a particular instance of a more generalised power mean defined as:$$M_p(a_1, a_2, ..., a_n) \equiv \bigg( \frac{1}{n} \sum_{k=1}^n a_k^{\,p} \bigg)^{1/p} $$where the parameter \(p\) is an affinely extended real number and all \(a_k \geq 0\). A power mean is also known as a generalized mean, Hölder mean, or mean of degree (or order or power) \(p\). The case of \(p=1\) is the arithmetic mean and the case of \(p=2\) is the root-mean-square. 

Figure 3 shows a summary of a few particular values of \(p\) that yield special cases with their own names (source):

Figure 3

The three "classic" means \(A\) (the arithmetic mean), \(G\) (the geometric mean), and \(H\) (the harmonic mean) are sometimes known as the Pythagorean means. Figure 4 shows how these means on two elements \(a\) and \(b\) could be constructed geometrically, and also demonstrates that \(H \leq G \leq A\).


Figure 4: source