Showing posts with label ulam. Show all posts
Showing posts with label ulam. Show all posts

Monday, 17 August 2026

28260: An Interesting Number

Sometimes it's difficult to find many interesting properties for numbers greater than 28000. However, 28260 is definitely not one of those sorts of numbers. It has a plethora of interesting properties and in this post I'll list some of them. Firstly though, let's list its prime factorisation:$$ \textbf{28260} = 2^2 \times 3^2 \times 5 \times 157$$PROPERTY 1: sum of two squares

As can be seen, the number is a product of a power of 2 (\( 2^2\)), a 4\(k\)+1 prime raised to an even power (\(3^2\)) and two 4\(k\)+1 primes (5 and 157). This means that it can be expressed as a sum of two squares in two different ways, viz.:$$ \begin{align} \textbf{28260} &= 6^2+168^2\\ \textbf{28260} &= 96^2+138^2 \end{align} $$PROPERTY 2: a, b, c, d number

It is what I've termed an \(a, b, c, d\) number because its digits can be rearranged to form three different numbers with the property that \(a+b+c=d\) where all four numbers share identical digits. In this case, there are two possible arrangements:$$ \begin{align} 26082 + 26280 + \textbf{28260} &= 80622\\ 26280 + 28062 + \textbf{28260} &= 82602 \end{align} $$PROPERTY 3: d-powerful number

It is digitally powerful (or \(d\)-powerful) because it can be expressed as a sum of positive powers of its digits. Here we have:$$ \textbf{28260} = 2^{14} + 8^4 + 2^2 + 6^5 + 0$$Of additional interest is that this number is the beginning of chain of ten consecutive numbers with this property. See Figure 1.


Figure 1


PROPERTY 4: Ulam number

It is an Ulam number. The Ulam sequence is defined by \(U_1=1\), \(U_2=2\)  and, for \(k>2\), \(U_k\) is the smallest integer that can be written in exactly one way as \(U_i+U_j\) with \(i<j<k\). Here we have:$$ \textbf{28260}=3 + 28257$$PROPERTY 5: gapful number

It a gapful number defined as a number of at least 3 digits that is divisible by the number formed by its first and last digits. Here the first and last digits form the number 20 and 20 is indeed a divisor:$$ \frac{ \textbf{28260}}{20} = 1413$$PROPERTY 6: untouchable number

It is an untouchable number defined as a number \(n\) that is not the sum of the proper divisors of any number \(k\). In other words:$$ \textbf{28260} \neq \sigma(k)-k \text{ for any }k $$PROPERTY 7: inconsummate number

It is an inconsummate number defined as a number \(n\) for which there is no number $k$ such that \(k\) divided by its sum of digits (SOD) gives $n$. Thus we have:$$ \frac{k}{\text{SOD}(k)}\neq \textbf{28260} \text{ for any } k$$PROPERTY 8: tau number

is a tau number since it is divisible by its number of divisors. Here there are 36 divisors and we have:$$ \frac{\textbf{28260}}{36}=785$$PROPERTY 9: Harshad number

It is a Harshad number defined as number that is divisible by the sum of its digits. Here we have a sum of digits of 18 and:$$ \frac{\textbf{28260}}{18}=1570$$PROPERTY 10: zeroes of the Mertens function

It is a number where the Mertens function has a value of zero. It forms a pair of consecutive numbers with 28259.

I examined the Möbius and Mertens functions in a post titled The Möbius Function and Mertens Function on January 25th 2020. In number theory, we define the Mertens function as:$$M(n) = \sum_{1\le k \le n} \mu(k)$$where \( \mu (k)\) is the Möbius function. For any positive integer n, \(μ(n)\) has values in {−1, 0, 1} depending on the factorisation of \(n\) into prime factors:$$\mu(n) = \begin{cases} 1 & \quad \text{if } n \text{ is square-free + integer with even number of prime factors}\\ -1 & \quad \text{if } n \text{ is square-free + integer with odd number of prime factors}\\ 0 & \quad \text{if } n \text{ has a squared prime factor} \end{cases}$$Figure 2 shows the situation:

Figure 2

There are many other properties that the number has but this covers most of the more interesting.

Sunday, 7 March 2021

Neglected Numbers

Sometimes it's easy to give up on numbers. Take 26271 for example. This number represents my diurnal age today and when I searched in the OEIS nothing of interest showed up. Even a search using OEIS + 26271, which often throws up OEIS b-files containing the number, didn't reveal anything interesting. 

Figure 1: link

In such situations I fall back on the Sequence Database: a database with 2402879 machine generated integer and decimal sequences. I discovered this site in June of 2020. Unfortunately, this didn't turn up any sequences of interest either but then I remembered another site that lists sequences (see Figure 1). 

It was here that I found something of substance. See Figure 2.


Figure 2

26271 belongs to a sequence of numbers \(n\) with the property that \(n\) is 5-almost prime and \(n+1 \) is 6-almost prime. In the case of 26271, it factors to \(3^3 \times 7 \times 139 \) and 26272 factors to \(2^5 \times 821\). The example of 728, the first member of the sequence, is given in Figure 1.

It's easy enough to generate this sequence in SageMath, using the algorithm shown in Figure 3:


Figure 3: permalink

This algorithm can be easily modified to search for other patterns involving \(k\)-almost primes where \(k \geq 2\). For example, what numbers \(n\) are there, up to 26271, with the property that \(n\) is 4-almost prime and \(n+1 \) is 5-almost prime? These numbers turn out to be quite numerous and I won't list them all here but notice how 26270 makes an appearance:

495, 975, 1071, 1287, 1484,  ... , 26075, 26103, 26195, 26215, 26270

From this we can see that 26271 is the middle term in a triplet of numbers with the property that: 
  • \(26270 = 2 \times 5 \times 37 \times 71\) and is 4-almost prime
  • \(26271 = 3^3 \times 7 \times 139 \) and is 5-almost prime
  • \(26272 = 2^5 \times 821\) and is 6-almost prime
This condition could be a good candidate for admission to the OEIS. It could be framed as follows:
Numbers \(n\) such that \(n-1\) is 4-almost prime, \(n\) is 5-almost prime and \(n+1\) is 6-almost prime.
Up to 100,000 the members of this sequence are:
11151, 13455, 23375, 26271, 31311, 33776, 36125, 40375, 45495, 46375, 48411, 49049, 49167, 61335, 63125, 74151, 77895, 78111, 78351, 80271, 82575, 83511, 84591, 86031, 87375, 88749, 90207

I checked and this sequence is not currently in the OEIS so I'll put it forward as a candidate and report back here when it's approved.

Reporting back, I'm happy to report that the sequence was approved, although one of the arbiters took exception to my use of the term \(n\)-almost prime and suggested that it be replaced by composite with \(n\) prime factors. I followed this suggestion (always a good idea to keep the arbiters on side) and the result is OEIS A342246:


 A342246

Numbers \(n\) such that \(n-1\), \(n\) and \(n+1\) are all composite with four, five and six (not necessarily distinct) prime factors respectively

Before I discovered the 5-almost prime and 6-almost prime link on the Italian site, I also made a discovery of my own. 26271 is a member of a sequence of numbers such that the sum of its digits is equal to the sum of the digits of its totient. Here the digits of 26271 add to 18 and the digits of its totient 14904 also add to 18. Up to 26271, about 7.61% of numbers have this property. The members of this sequence, up to 1000, are as follows:

1, 21, 27, 34, 54, 63, 81, 106, 108, 117, 126, 129, 135, 136, 142, 147, 156, 162, 171, 178, 195, 205, 212, 214, 216, 234, 237, 243, 252, 270, 272, 291, 315, 324, 333, 342, 351, 356, 358, 394, 402, 405, 424, 432, 441, 459, 493, 502, 504, 513, 538, 540, 544, 565, 585, 624, 630, 663, 702, 712, 714, 716, 718, 723, 729, 745, 804, 810, 831, 834, 835, 840, 864, 873, 918, 932, 934, 936, 943, 981

This discovery also prompted me to investigate the sum of the digits of the sum of the divisors. The percentage of numbers whose sum of digits equals the sum of the digits of the sum of its divisors is 4.59%. The members of this sequence, up to 1000, are as follows:

1, 15, 24, 64, 69, 78, 90, 114, 133, 147, 153, 186, 198, 258, 270, 276, 288, 306, 339, 360, 366, 393, 429, 474, 492, 495, 507, 522, 582, 588, 609, 618, 627, 639, 708, 717, 738, 762, 763, 801, 817, 834, 846, 871, 906, 933, 960, 978, 990

The percentage of numbers whose sum of digits equals both the sum of the digits of the sum of its divisors AND the sum of the digits of its totient is 0.727%. The members of this sequence, up to 10000, are as follows:

1, 147, 270, 834, 1158, 1374, 1377, 2028, 2214, 2436, 2454, 2538, 2592, 2646, 2754, 2862, 2907, 3339, 3726, 4293, 4320, 4371, 4614, 5049, 5262, 5319, 5472, 5508, 5607, 5670, 5751, 5802, 6234, 6291, 6426, 6570, 6972, 7155, 7209, 7434, 7560, 7605, 7614, 8190, 8934, 9126, 9270, 9315, 9333, 9342, 9720, 9744, 9810

This last sequence might be an interesting one for admission to the OEIS (as it's not currently in there) but I'll wait until my current submission is approved. This is again easy to generate in SageMath as Figure 4 shows:


Figure 4: permalink

In conclusion, it can be said that 26271 is an Ulam number, being the sum of two previous Ulam numbers, namely 47 and 26224. It is also a happy number since repeated sums of squares of digits lead to 1. However, as we've seen, it also has other interesting properties that a little research uncovered.

Wednesday, 3 October 2018

Ulam Numbers

I've been encountering these numbers for a while now, ever since making use of the website NUMBERS APLENTY which categorises numbers in a wide variety of ways and one of those categories is that of the Ulam number. Yesterday for example I was 25384 days old and 25384 is an Ulam number defined by the site as:
The Ulam sequence is defined by \(U_1=1, U_2=2 \) and, for \( k>2, U_k \) is the smallest integer that can be written in exactly one way as \(U_i+U_j \) with \( i<j<k \). The members of the Ulam sequence are called Ulam numbers. 
For example, after the first 4 terms which are trivially 1, 2, 3 and 4, the value of \(U_5 \) cannot be 5, since \(5=U_1+U_4=U_2+U_3 \), but it is 6, which can be obtained only as  \( U_2+U_4\)  (not as \(U_3+U_3 \) because the terms added must be distinct).
The problem with the Online Encyclopaedia of Integer Sequences (OEIS) is that it will not flag large numbers like 25384 as Ulam numbers because the numbers in the Ulam sequence (OEIS A002858) are only listed up to 339.
1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, 36, 38, 47, 48, 53, 57, 62, 69, 72, 77, 82, 87, 97, 99, 102, 106, 114, 126, 131, 138, 145, 148, 155, 175, 177, 180, 182, 189, 197, 206, 209, 219, 221, 236, 238, 241, 243, 253, 258, 260, 273, 282, 309, 316, 319, 324, 339
There is a list of the first 10,000 Ulam numbers in the links but these numbers do not show up in a search of the OEIS. That's why sites like NUMBERS APLENTY are so useful as a supplement to the OEIS. The site always provides a link to the relevant sequence in the OEIS as well as a Mathworld and Wikipedia link.

So what's special about the Ulam numbers? To begin with they are not distributed uniformly. As the NUMBERS APLENTY website states:
Ulam numbers are not distributed uniformly, but their density has peaks at an average distance of 21.6 (see Figure 1):
A plot of the Ulam numbers up to 1082, arranged line by line in a square 108×108. 
The plot shows the peaks in their density that occur with a frequency roughly equal to 108/5=21.6.
Wikipedia claims that the Ulam numbers have a density of approximately 0.07398 or 7.4%. It also states that:
There are infinitely many Ulam numbers. For, after the first n numbers in the sequence have already been determined, it is always possible to extend the sequence by one more element: \( U_{n − 1} + U_n \) is uniquely represented as a sum of two of the first n numbers, and there may be other smaller numbers that are also uniquely represented in this way, so the next element can be chosen as the smallest of these uniquely representable numbers.
Wikipedia goes on to say that:
The idea can be generalised as (u, v)-Ulam numbers by selecting different starting values (u, v). A sequence of (u, v)-Ulam numbers is regular if the sequence of differences between consecutive numbers in the sequence is eventually periodic. When v is an odd number greater than three, the (2, v)-Ulam numbers are regular. When v is congruent to 1 (mod 4) and at least five, the (4, v)-Ulam numbers are again regular. However, the Ulam numbers themselves do not appear to be regular. 
A sequence of numbers is said to be s-additive if each number in the sequence, after the initial 2s terms of the sequence, has exactly s representations as a sum of two previous numbers. Thus, the Ulam numbers and the (u, v)-Ulam numbers are 1-additive sequences. 
If a sequence is formed by appending the largest number with a unique representation as a sum of two earlier numbers, instead of appending the smallest uniquely representable number, then the resulting sequence is the sequence of Fibonacci numbers. 
This last point about the similarity with the Fibonacci numbers is interesting. Of course the Fibonacci numbers get very big very quickly while the Ulam numbers, because the smallest sum of any two previous numbers is sought, remain relatively smaller.

 Mathworld has a table of some of the other Ulam sequences:


I was struggling to get my SAGE code to generate these sequences of terms but came across some Python 2 code (source) that does the job, although I'm struggling to understand how it works:
ulams=[ ]
ulams.append(1)
ulams.append(2)
limit=100
sums=[0 for i in range(2*limit)]
newUlam=2
sumIndex=1
while(newUlam <limit):
  for i in ulams:
if (i<newUlam):
sums[i+newUlam] += 1
while(sums[sumIndex]!=1):
sumIndex += 1
newUlam = sumIndex
sumIndex += 1
ulams.append(newUlam) for i in ulams:
print i
With the limit set to 100, the following output is produced: 1 2 3 4 6 8 11 13 16 18 26 28 36 38 47 48 53 57 62 69 72 77 82 87 97 99 102

The code can be easily modified to generate other sequences with different starting terms e.g. 2 and 3:
ulams=[ ]
ulams.append(2)
ulams.append(3)
limit=100
sums=[0 for i in range(2*limit)]
newUlam=3
sumIndex=1
while(newUlam <limit):
  for i in ulams:
if (i<newUlam):
sums[i+newUlam] += 1
while(sums[sumIndex]!=1):
sumIndex += 1
newUlam = sumIndex
sumIndex += 1
ulams.append(newUlam) for i in ulams:
print i
This code produces the output: 2 3 5 7 8 9 13 14 18 19 24 25 29 30 35 36 40 41 46 51 56 63 68 72 73 78 79 83 84 89 94 115

ADDENDUM: I finally developed my own code which I do understand and it works! Here are the terms below 200 in the Ulam sequence beginning 2,3:
ulam=[i for i in range(1,200)]
ulam[0], ulam[1]=2,3
k=2
while k<len(ulam):
    count=0
    for x in range(k):
        for y in range(k):
            if ulam[x] > ulam[y]:
                if ulam[x] + ulam[y] == ulam[k]:
                    count+=1
    if count!=1:
        ulam.remove(ulam[k])
        k-=1
    k+=1
print ulam  
This code produces the output: 2, 3, 5, 7, 8, 9, 13, 14, 18, 19, 24, 25, 29, 30, 35, 36, 40, 41, 46, 51, 56, 63, 68, 72, 73, 78, 79, 83, 84, 89, 94, 115, 117, 126, 153, 160, 165, 169, 170, 175, 176, 181, 186, 191

Here is a link to an interesting article that looks at patterns in these 1-additive sequences.