Showing posts with label divisor. Show all posts
Showing posts with label divisor. Show all posts

Monday, 17 November 2025

Testing AI

I thought I might challenge AI to guess the next number in a given sequence. This was my query:

Can you propose what the next number in this sequence of numbers might be and explain your reasoning$$1, 3, 7, 13, 7, 31, 43, 19, 73, 13, 37, \dots$$First up I asked Grok and got a rather curious response:

Uh-oh, too much information for me to digest all at once. You know, sometimes less is more!

That wasn't much help so I turned to Gemini and ChatGPT. They both accepted the challenge and tried their best but neither came up with anything convincing. Finally I gave the latter the following clue:

I'll give a clue. The numbers are generated by a simple quadratic function (using the integers 0, 1, 2, 3 , ... progressively as input) that collapses composite numbers when they appear according to a simple division rule. 

 Nice clue — that nails it.

The quadratic is \(f(n)=n^2+n+1\) for integer inputs \(n=0,1,2,\dots \). 

The collapse rule: whenever \(f(n) \) is composite, divide it by its smallest prime factor (and repeat if necessary) until the result is prime.

Checking the given terms (I'll show \(n\) \( \rightarrow \) raw \(f(n)\) \( \rightarrow \) collapsed result):

  • \(n=0: f=0^2+0+1=1 \rightarrow 1\)

  • \(n=1: f=1^2+1+1=3 \rightarrow 3\)

  • \(n=2: f=4+2+1=7 \rightarrow 7 \)

  • \(n=3: f=9+3+1=13 \rightarrow13 \)

  • \(n=4: f=16+4+1=21 \rightarrow 21/3=7 \)

  • \(n=5: f=25+5+1=31 \rightarrow 31\)

  • \(n=6: f=36+6+1=43 \rightarrow 43 \)

  • \(n=7: f=49+7+1=57 \rightarrow 57/3=19 \)

  • \(n=8: f=64+8+1=73 \rightarrow 73\)

  • \(n=9: f=81+9+1=91 \rightarrow 91/7=13 \)

  • \(n=10: f=100+10+1=111 \rightarrow 111/3=37\)

All match your sequence.

Now the next input:$$n=11: f(11)=121+11+1=133 \rightarrow 133/7 = 19$$ So the next number in the sequence is 19.

So a little clue and ChatGPT, as it said, nailed it. This was just a little experiment to see what how AI would handle a problem that is actually quite challenging. The sequence is NOT listed in the OEIS by the way.

I challenged ChatGPT to come with a similar challenge and this is what it generated:

Could you propose a similar but different challenge. You should try to be creative and innovative but adhering to the general algorithm, namely generate a sequence of numbers according to a definite rule but modify certain numbers according to another definite rule whenever they satisfy a certain preestablished criterion. Go for it.

Nice — here’s a fresh puzzle in the same spirit as yours: a definite generating rule (a simple quadratic) plus a deterministic “collapse” rule that kicks in whenever the raw value meets a criterion.

I had to take a screenshot of the puzzle as copying and pasting introduces tedious formatting challenges.

Wednesday, 14 May 2025

Some Interesting Integer Ratios

The number \( \textbf{27800} \) (my diurnal age today) has the following divisors: 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 139, 200, 278, 556, 695, 1112, 1390, 2780, 3475, 5560, 6950, 13900, 27800. If we concatenate these divisors in the order shown (from smallest to largest) we get the rather large integer shown below.

1245810202540501001392002785566951112139027803475556069501390027800

The sum of these divisors is 65100 and it so happens that 65100 divides this concatenated number without remainder to give:

19136869470668218147342592712241952567419781927427896612924578

Numbers with this property belong to OEIS A308486: numbers such that the sum of divisors divides the concatenation (in ascending order) of divisors. The initial members up to 40000 are (permalink):

1, 2, 6, 10, 40, 98, 112, 120, 1904, 2680, 4040, 4128, 5136, 9920, 12224, 17900, 20880, 27800

Looking at the number 98 in the list we see that its divisors are 1, 2, 7, 14, 49 and 98 that have a total sum of 171 and whose concatenated divisors form the number 127144998. Thus we have:$$ \begin{align} \frac{127144998}{171} &= \frac{2 \times 3^3 \times 19 \times 123923}{3^2 \times 19} \\ &= 2 \times 3 \times 123932 \\ &=743538 \end{align} $$What if we consider the concatenation of a number's factors (with repetition) and whether it can be divided by its sum of factors (again with repetition). We need to ignore the prime numbers or else they will all get included. There are 277 composite numbers satisfying the criterion in the range up to 40000 (permalink):

8, 14, 20, 24, 27, 62, 125, 150, 160, 180, 194, 218, 300, 343, 452, 510, 512, 548, 570, 605, 612, 627, 651, 662, 663, 720, 935, 1183, 1210, 1235, 1331, 1335, 1575, 1676, 1994, 2090, 2106, 2130, 2197, 2218, 2303, 2337, 2345, 2350, 2428, 2436, 2640, 2667, 2675, 2679, 2744, 3087, 3102, 3108, 3168, 3237, 3275, 3399, 3509, 3553, 3740, 3835, 4029, 4046, 4125, 4180, 4347, 4384, 4392, 4410, 4488, 4565, 4704, 4805, 4913, 5015, 5037, 5047, 5120, 5551, 5829, 5888, 5968, 6223, 6250, 6549, 6662, 6666, 6747, 6837, 6859, 6888, 6923, 7030, 7189, 7337, 7448, 7449, 7462, 7488, 8000, 8064, 8165, 8246, 8421, 8624, 8742, 8853, 8949, 9000, 9331, 9344, 9709, 9804, 9975, 9990, 10017, 10125, 10146, 10240, 10387, 10800, 10854, 10865, 10879, 10989, 11045, 11121, 11205, 11264, 11704, 11891, 12032, 12152, 12167, 12288, 12337, 13237, 13243, 13277, 13284, 13702, 13792, 13824, 13858, 14308, 14457, 14555, 14580, 15015, 15025, 15042, 15054, 15301, 15552, 15820, 16038, 16428, 16549, 16827, 16856, 17347, 17496, 17600, 17850, 17914, 17949, 18172, 18213, 18377, 18495, 18821, 18963, 19135, 19425, 19513, 19683, 19860, 19885, 19910, 20041, 20083, 20727, 20746, 20878, 20951, 21033, 21175, 21197, 21340, 21965, 21978, 22008, 22021, 22152, 22275, 22317, 23069, 23280, 23548, 23715, 23785, 23998, 24037, 24244, 24389, 24986, 25182, 25344, 25647, 26129, 26754, 27010, 27480, 27664, 27832, 27880, 28006, 28037, 28566, 28577, 28840, 28896, 29064, 29281, 29326, 29388, 29602, 29614, 29624, 29783, 29791, 30082, 30186, 30226, 30229, 30240, 30420, 30814, 30825, 31097, 31349, 31412, 31581, 31780, 32076, 32418, 32640, 32697, 33292, 33473, 33480, 34132, 34133, 34481, 34521, 34773, 35046, 35557, 35616, 36022, 36040, 36162, 36176, 36478, 36504, 37026, 37789, 38024, 38200, 38340, 38399, 38480, 38658, 39292, 39406, 39463

This sequence of numbers is NOT to be found in the OEIS. Let's look at one of the numbers in the above list, namely 27832.$$27832=2^3 \times 7^2 \times 71$$The concatenated factors form the number 2227771 and the sum of these divisors is 91. Thus we have:$$ \begin{align} \frac{2227771}{91} &= \frac{7 \times 13 \times 24481}{7 \times 13} \\ &=24481 \end{align} $$There are other variations on the two themes covered in this post. For example, we could consider only the proper divisors of a number and look for numbers whose proper divisors, when concatenated from smallest to largest, are divisible by the sum of the proper divisors. We need to exclude prime numbers because the proper divisor in every case is 1 and thus will divide any number. There are 38 composite numbers in the range up to 40000 (permalink):

4, 15, 18, 24, 69, 208, 247, 501, 559, 565, 692, 697, 1501, 2077, 2257, 2759, 3551, 3661, 4135, 4227, 5123, 5461, 5536, 6109, 8640, 10821, 12179, 12667, 13631, 16939, 19781, 23587, 24307, 26827, 27331, 30701, 33877, 38887

Let's consider 69 in the previous list. It has proper divisors of 1, 3 and 23 that form the concatenated number 1323 with a sum of 27. Thus we have:$$ \begin{align} \frac{1323}{27} &= \frac{3^3 \times 7^2}{3^3} \\ &=7^2 \\ &=49 \end{align}$$Again this sequence is NOT to be found in the OEIS. Interestingly, the concatenated proper divisors of 8640 (one of the sequence members) form the following enormous cancatenated number:

12345689101215161820242730323640454854606472809096108120135144160180192216240270288320360432480540576720864960108014401728216028804320

Friday, 15 March 2024

Of Substrings and Divisors

Today I turned 27375 days old and this number has an interesting property in that:$$ \begin{align} 27375 &=375 \times 73  \\ &=5 \times 73 \times 75 \end{align}$$Looking at the numbers on the RHS of the equations, it can be seen that 5, 73, 75 and 375 are all substrings of the string 27375, considering the numbers as collections of characters rather than digits. The numbers with this property form OEIS A059470:


 A059470

Numbers that are the products of distinct substrings (>1) of themselves and do not end in 0.



These numbers are not numerous and up to 40000 they are:

125, 375, 735, 1197, 1296, 1352, 1593, 1734, 2346, 3125, 4224, 4872, 5775, 8448, 9072, 11715, 12768, 13455, 14476, 14673, 15625, 16128, 17136, 17493, 18432, 21168, 22176, 23184, 23391, 27216, 27375, 27648, 27864, 32256, 34272, 34398, 36288, 36864, 37296, 39375

The breakdown into divisors/substrings is as follows with some numbers having more than one representation (permalink):

125 equals the product of [25, 5]
375 equals the product of [75, 5]
735 equals the product of [35, 3, 7]
1197 equals the product of [9, 19, 7]
1296 equals the product of [9, 2, 12, 6]
1352 equals the product of [2, 52, 13]
1593 equals the product of [9, 3, 59]
1734 equals the product of [17, 34, 3]
2346 equals the product of [3, 34, 23]
3125 equals the product of [25, 125]
4224 equals the product of [24, 2, 4, 22]
4872 equals the product of [87, 7, 8]
4872 equals the product of [2, 4, 87, 7]
5775 equals the product of [75, 77]
8448 equals the product of [48, 4, 44]
9072 equals the product of [72, 9, 2, 7]
11715 equals the product of [11, 15, 71]
12768 equals the product of [2, 7, 12, 76]
13455 equals the product of [13, 3, 345]
14476 equals the product of [7, 44, 47]
14673 equals the product of [3, 73, 67]
15625 equals the product of [625, 25]
16128 equals the product of [6, 8, 12, 28]
17136 equals the product of [3, 6, 7, 136]
17493 equals the product of [17, 3, 49, 7]
18432 equals the product of [32, 4, 18, 8]
21168 equals the product of [21, 6, 168]
22176 equals the product of [176, 21, 6]
23184 equals the product of [3, 4, 84, 23]
23391 equals the product of [339, 3, 23]
27216 equals the product of [6, 21, 216]
27216 equals the product of [2, 7, 72, 27]
27375 equals the product of [375, 73]
27375 equals the product of [5, 73, 75]
27648 equals the product of [64, 2, 8, 27]
27864 equals the product of [2, 6, 86, 27]
32256 equals the product of [32, 3, 6, 56]
34272 equals the product of [3, 42, 272]
34272 equals the product of [2, 34, 7, 72]
34272 equals the product of [2, 34, 3, 4, 42]
34398 equals the product of [9, 98, 39]
36288 equals the product of [2, 3, 36, 6, 28]
36864 equals the product of [64, 3, 4, 6, 8]
37296 equals the product of [2, 37, 7, 72]
37296 equals the product of [2, 7, 296, 9]
37296 equals the product of [3, 6, 7, 296]
39375 equals the product of [3, 5, 7, 375]

I adapted the code for generating the substrings from this source (see Figure 1).


While these numbers are not frequent, there are two coming up in the relatively near future (27648 and 27864) before there is a big gap to the next number, 32256.

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.

Wednesday, 22 February 2023

Modest Numbers (Continued)

CONTINUED FROM PREVIOUS POST

I'm having to run the previous blog post into this new post because I found that the word wrap wasn't working despite numerous efforts to fix it. 

In this continuation, I want to mention the fact that some numbers are "modest" in two ways not just one. Here is a list of such numbers in the range up to 40,000:

1333, 1999, 2333, 2666, 2999, 3999, 4666, 4999, 5999, 6999, 7999, 8999, 11111, 13333, 19999, 21111, 22222, 23333, 26666, 29999, 31111, 33333, 39999

As can be seen, all numbers have many repeated digits. Let's look at the first number in the list, 1333. We see that:$$ \begin{align} 1333 \! \!\! \mod 33 \equiv 13\\1333 \! \! \! \mod 333 \equiv 1 \end{align} $$Once we extend the range to one million, we find some numbers that are "modest" in three ways. These are:

133333, 199999, 233333, 266666, 299999, 399999, 466666, 499999, 599999, 699999, 799999, 899999

Taking the first number in the list above, 133333, we find that:$$ \begin{align} 133333 \! \!\! \mod 333 \equiv 133\\133333 \! \! \! \mod 3333 \equiv 13\\133333 \! \! \! \mod 33333 \equiv 1 \end{align} $$Clearly there is a pattern here and if we were to extend the range even further we would find that there are numbers that are modest in four ways and more. For example, 13333333 is "modest" is four ways:$$ \begin{align} 13333333 \! \!\! \mod 3333 \equiv 1333\\13333333 \! \! \! \mod 33333 \equiv 133\\13333333 \! \! \! \mod 333333 \equiv 13\\13333333 \! \! \! \mod 3333333 \equiv 1 \end{align} $$Once the algorithm for splitting any two digit number or larger into two parts is in place, it can be applied to other scenarios other than modest numbers. For example, consider this scenario where we define a "digestible" number for want of a better term as follows:

A number \(n\) is called digestible if its digits can be separated into two numbers \(a\) and \(b\) such that \( n\) divides evenly into \(a^b\).

In the range up to 40,000, there are 41 numbers that satisfy this criterion. They are (permalink):

128, 256, 486, 648, 729, 1024, 1296, 2048, 2187, 3072, 4096, 6075, 6144, 6561, 6912, 8192, 10240, 12288, 13824, 14336, 15488, 15625, 16384, 16807, 17496, 18432, 20480, 21609, 22528, 24576, 26624, 27648, 28672, 30375, 30720, 32768, 33614, 34816, 35721, 36864, 38912

The details for each number are as follows:


Figure 1

Let's take the first number in this list, 128, that divides evenly into 12 raised to the 8th power. Now 12 raised to the 8th power is 429981696 and 128 | 429981696 = 3359232. This is just an example of the sorts of investigations that can be carried out. Notice how all the powers of 2 are represented.