Friday, 11 June 2021

Concatenations

Today I turned 26366 days old and yesterday, of course, I was 26365 days old. Each of these numbers have the property that the leading two digits (26) represent the number of fortnights in a year while the final three digits (365 and 366) represents the number of days in non-leap years and a leap years respectively. Incidentally, 26 fortnights represent 26 x 14 = 364 days and so 26364 encodes that fact. Similar pairs of numbers include:

  • 12365 and 12366 where 12 represents the number of months in a calendar year
  • 13365 and 13366 where 13 represents the number of lunar months in a calendar year
  • 52365 and 52366 where 52 represents the number of full weeks in a calendar year
The concatenation of numbers, according to WolframMathWorld, is represented by the symbol \( \parallel \) and thus 26\( \parallel \)366 = 26366. The formula for the concatenation in base \(b\) of two numbers, \(p\) and \(q\), is given by:$$p \parallel q=p \, b^{f(q)} + q \text{ where } f(q)=\left \lfloor \log_b{q} \right \rfloor + 1$$$$ \text{where }f(q) \text{ represents the length of } q$$Let's test this formula out in the case of 26366. We have \(p=26\) and \(q=366\). Clearly the length of \(q\) is 3 but let's check using \( \left \lfloor \log_{10}366 \right \rfloor + 1\). The value of this is indeed 3 so all is good.

When constructing an algorithm, the formula is useful as a way of accomplishing the concatenation without resorting to strings. Figure 1 shows the relevant SageMath code.


Figure 1: permalink

26365 and 26366 have some interesting shared properties. They are both semiprimes and emirpimes :
  • 26365 = 5 * 5273 and 56362 = 2 * 28181
  • 26366 = 2 * 13183 and 66362 = 2 * 33181
In recreational mathematics, there are some interesting applications of concatenation. One of these involves so-called home primes. These are primes obtained by repeatedly factoring the increasing concatenation of prime factors of a given number. I've written about these in an eponymous post on May 2nd 2021. Let's work out the home primes for 26364, 26365 and 26366.

For 26364, we find ten steps are required to reach the home prime: 
 
26364
223131313
792824447
10113956473
21147933443
713589739409
4059117579999
31353039193333
1113305413717887
313175353597790561

For 26365, only six steps are required:

26365
55273
311783
734271
3311787
31764937

For 26366, seven steps are required:

26366
213183
3323687
17195511
35731837
196728069
365576023

The Smarandache–Wellin numbers involve the concatenations of the first prime numbers. These numbers form OEIS A019518:


 A019518

Smarandache-Wellin numbers: a(n) is the concatenation of first n primes (written in base 10).


The sequence begins:

2
23
235
2357
235711
23571113
2357111317
235711131719
23571113171923
2357111317192329
235711131719232931
23571113171923293137
2357111317192329313741
235711131719232931374143
23571113171923293137414347

Of the numbers listed here only 2, 23 and 2357 are prime. The next such number that is prime has 355 digits!

If we concatenate the integers, we create the Champernowne constant, a transcendental real constant whose decimal expansion has important properties. It is named after economist and mathematician D. G. Champernowne, who published it as an undergraduate in 1933. I've written about this constant in an eponymous post on March 22nd 2019. The constant begins 12345678910111213141516 ... 

The Copeland–ErdÅ‘s constant is formed by the concatenation of "0." with the base 10 representations of the prime numbers in order. Its value, using the modern definition of prime, is approximately 0.235711131719232931374143…

There is a reverse integer sequence that comprises OEIS A000422:


 A000422

Concatenation of numbers from n down to 1.             


The sequence begins:

1
21
321
4321
54321
654321
7654321
87654321
987654321
10987654321
1110987654321
121110987654321
13121110987654321
1413121110987654321
151413121110987654321
16151413121110987654321
1716151413121110987654321
181716151413121110987654321

Interestingly, this sequence produces very few primes with the first being when \(n=82\) and the next being \(n=37765\).

We can concatenate the odd, even, triangular, square, cubic and Fibonacci numbers and all of these have associated OEIS sequences. Follow this link for more information.

No comments:

Post a Comment