Showing posts with label totient function. Show all posts
Showing posts with label totient function. Show all posts

Saturday, 9 September 2023

A Special Number Plate

Last night I noticed an unusual car number plate. It was 432 432.  This is a customised number plates as standard number plates follow an AAA 000 pattern, that is three uppercase letters followed by three digits. Presumably the number 432 was of some significance to the person who purchased the plates. This got me thinking about what is special about the number 432.

432 432

PROPERTY 1

The first property of interest is that it's wedged between two prime numbers: 431 and 433. Thus we have:$$432 = \frac{431+433}{2}$$This qualifies it for membership in OEIS A014574:


 A014574

Average of twin prime pairs.                                                    



The initial members of this sequence are:

4, 6, 12, 18, 30, 42, 60, 72, 102, 108, 138, 150, 180, 192, 198, 228, 240, 270, 282, 312, 348, 420, 432, 462, 522, 570, 600, 618, 642, 660, 810, 822, 828, 858, 882, 1020, 1032, 1050, 1062, 1092, 1152, 1230, 1278, 1290, 1302, 1320, 1428, 1452, 1482, 1488, 1608

PROPERTY 2

The next property of interest is that it's the sum of two cubes. Specifically:$$432=6^3+6^3$$This property qualifies it for membership in OEIS A003325:


 A003325

Numbers that are the sum of 2 positive cubes.                        



The initial members of this sequence are:

2, 9, 16, 28, 35, 54, 65, 72, 91, 126, 128, 133, 152, 189, 217, 224, 243, 250, 280, 341, 344, 351, 370, 407, 432, 468, 513, 520, 539, 559, 576, 637, 686, 728, 730, 737, 756, 793, 854, 855, 945, 1001, 1008, 1024, 1027, 1064, 1072, 1125, 1216, 1241, 1332, 1339, 1343

PROPERTY 3

The next property is that it's the sum of the totients of the first 37 numbers: $$432=\sum_{n=1}^{37} \phi(n)$$This qualifies it for membership in OEIS A002088:


 
 A002088

Sum of totient function: \( \displaystyle{\text{a}(n) = \sum_{k=1}^n \phi(k) } \) 
              


The initial members of the sequence are:

0, 1, 2, 4, 6, 10, 12, 18, 22, 28, 32, 42, 46, 58, 64, 72, 80, 96, 102, 120, 128, 140, 150, 172, 180, 200, 212, 230, 242, 270, 278, 308, 324, 344, 360, 384, 396, 432, 450, 474, 490, 530, 542, 584, 604, 628, 650, 696, 712, 754, 774, 806, 830, 882, 900, 940, 964

PROPERTY 4
  
Another property makes it a member of OEIS A033833:


 A033833

Highly factorizable numbers: numbers with a record number of proper factorizations.


432 turns out to have 56 possible factors which are:

[2, 2, 2, 2, 3, 3, 3], [2, 2, 2, 2, 3, 9], [2, 2, 2, 2, 27], [2, 2, 2, 3, 3, 6], [2, 2, 2, 3, 18], [2, 2, 2, 6, 9], [2, 2 , 2, 54], [2, 2, 3, 3, 3, 4], [2, 2, 3, 3, 12], [2, 2, 3, 4, 9], [2, 2, 3, 6, 6], [2, 2, 3, 36], [2, 2, 4, 27], [2, 2, 6, 18], [2, 2, 9, 12], [2, 2, 108], [2, 3, 3, 3, 8], [2, 3, 3, 4, 6], [2, 3, 3, 24], [2, 3, 4, 18], [2, 3, 6, 12], [2, 3, 8, 9], [2, 3, 72], [ 2, 4, 6, 9], [2, 4, 54], [2, 6, 6, 6], [2, 6, 36], [2, 8, 27], [2, 9, 4], [2, 12, 18], [2, 216], [3, 3, 3, 4, 4], [3, 3, 3, 16], [3, 3, 4, 12], [3, 3, 6, 8], [3, 3, 48], [3, 4, 4, 9], [3, 4, 6, 6], [3, 4, 36], [3, 6, 24], [3, 8, 18], [3, 9, 16], [3, 12, 12], [3, 144], [4, 4, 27], [4, 6, 18], [4, 9, 12], [4, 108], [6, 6, 12], [6, 8, 9], [6, 72], [8, 54], [9, 48], [12, 36], [16, 27], [18, 24]

It can be noted that 666 makes its appearance since 432 = 2 x 6 x 6 x 6.

The initial members of the sequence are:

1, 4, 8, 12, 16, 24, 36, 48, 72, 96, 120, 144, 192, 216, 240, 288, 360, 432, 480, 576, 720, 960, 1080, 1152, 1440, 2160, 2880, 4320, 5040, 5760, 7200, 8640, 10080, 11520, 12960, 14400, 15120, 17280, 20160, 25920, 28800, 30240, 34560

PROPERTY 5

Another property of 432 is that it's the difference between the squares of two successive primes. Specifically$$ \begin{align} 432&=109^2-107^2\\&=(109+107) \times (109-107)\\&=216 \times 2\\ &=2^4 \times 3^3 \end{align} $$This qualifies 432 for inclusion in OEIS A069482:


 A069482

a(\(n\)) = (prime(\(n\)+1))\(^2\) - (prime(\(n\)))\(^2\)                                



The initial members of the sequence are:

5, 16, 24, 72, 48, 120, 72, 168, 312, 120, 408, 312, 168, 360, 600, 672, 240, 768, 552, 288, 912, 648, 1032, 1488, 792, 408, 840, 432, 888, 3360, 1032, 1608, 552, 2880, 600, 1848, 1920, 1320, 2040, 2112, 720, 3720, 768, 1560, 792, 4920, 5208, 1800, 912, 1848

I'll stop there as I think I've shown that 432 has at least five interesting properties but of course there are many more. There are actually 4018 entries for this number in the OEIS.

Monday, 23 August 2021

Recursion involving the Totient Function

With plenty of time on my hands and my mind being lately obsessed with recursive processes, I contemplated what might happen if I took a number and added its totient plus one to it, repeating the process with the new number and only terminating when a prime number was reached. Put mathematically and applied to a number \(n\), we have:$$n \rightarrow n+\phi(n)+1$$The first thing to realise is that for any prime number \(p\), this process will yield:$$p \rightarrow p+\phi(p)+1=p+p-1+1=2p$$and so any prime is initially doubled by this process. Remember the totient \( \phi(n) \) of \(n\) is the number of coprime integers less than \(n\), including 1.

Using SageMathCell, I was able to quickly determine the trajectories for all numbers up to 6000  and the distribution is shown in Figure 1. The vertical axis shows the trajectory length while the horizontal axis shows the number. Some of the record trajectories are shown in Figure 1 as well e.g. (97, 152) indicates that the number 97 sets a new trajectory record length of 152.


Figure 1: permalink

Below are shown the numbers that produce trajectories of record length, together with those lengths:
  •       1  has a trajectory of record length      1
  •       2  has a trajectory of record length      2
  •       3  has a trajectory of record length      8
  •     31  has a trajectory of record length     10
  •     42  has a trajectory of record length     31
  •     97  has a trajectory of record length   152
  •  1907  has a trajectory of record length   166
  •  2130  has a trajectory of record length   217
  •  3067  has a trajectory of record length   224
  •  5243  has a trajectory of record length   232
  •  7355  has a trajectory of record length   302
  •  7604  has a trajectory of record length   307
  • 10956 has a trajectory of record length >344
SageMathCell timed out for 10956 because the composite numbers were becoming unwieldingly large. See Figure 2.


Figure 2

The final number is the list shown in Figure 2 is:

128273423043384555138014803867139463949464184741011497767099217473602278 

It was at this point that SageMathCell gave up. Presumably the trajectory of 10956 does terminate but so far I've not been able to determine its exact length, although we know it's larger than 344. The average number of iterations is slightly over 14 in the range up to 6000.

I may have more to add on this recursive process at a later date.

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.

Monday, 2 November 2020

Cyclotomic Polynomials

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


A138938

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

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

for n in [1..20]:

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

\( \Phi_1 = x - 1\)

\( \Phi_2 = x + 1\)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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


Figure 1

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

Wednesday, 28 October 2020

Phi - Sigma Loops

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


A095953



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


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

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

Figure 1

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

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

[26118, 26120, 26140, 26166]