Why does this pattern happen?

apple2357

Full Member
Joined
Mar 9, 2018
Messages
520
Someone sent me this on twitter. It's pretty.
I am wondering what is it about this that makes it work? Any thoughts on what I could explore? I know that there are sometimes interesting outcomes when you play with x9, x99 etc. But this is not quite the same thing...
 

Attachments

  • WhatsApp Image 2019-12-24 at 08.19.59.jpeg
    WhatsApp Image 2019-12-24 at 08.19.59.jpeg
    63.4 KB · Views: 16
You could try doing the first few "x 8" by hand and see if you notice a pattern.

Alternatively consider...
Code:
Step n  : (a           )*8 + (b  ) = c            (1)
Step n+1: (a*10 + (b+1))*8 + (b+1) = x            (2)
Now use the above equations to find x in terms of c and b (eliminate a).
 
[MATH]\text {Define } n \in \mathbb Z \text { and } n > 2.[/MATH]
[MATH]\text {Define } p_0 = 0.[/MATH]
[MATH]\text {Define } q_0 = 0.[/MATH]
[MATH]k \text { is a positive integer} < n \implies p_k = np_{k-1} + k \text { and } q_k = (n - 2)p_k + k.[/MATH]
This generalizes the problem. In the actual problem, n = 10. But we shall work through the problem if n = 8 or n = 16 as well.

Lat's look at the first 3 p's if n = 8 or n = 10 or n = 16.

[MATH]n = 8 \implies p_1 = 8(0) + 1 = 1 = 8^0(1), \ p_2 = 8(1) + 2 = 10 = 8^1(1) + 8^0(2), \text { and }[/MATH]
[MATH]q_3 = 8(10) + 3 = 83 = 8^2(1) + 8^1(2) + 8^0(3).[/MATH]
Although the sequence 1, 10, 83 does not seem interesting, it becomes so if we show those numbers in octal notation. They become 1, 12, and 123 in octal.

[MATH]n = 10 \implies p_1 = 10(0) + 1 = 1, \ p_2 = 10(1) + 2 = 12, \text { and } p_3 = 10(12) + 3 = 123.[/MATH]
Same digits in decimal.

[MATH]n = 16 \implies p_1 = 16(0) + 1 = 1,\ p_2 = 16(1) + 2 = 18 = 16^1(1) + 16^0(2), \text { and }[/MATH]
[MATH]p_3 = 16(18) + 3 = 291 16^2(1) + 16^1(2) + 16^0(3).[/MATH]
Same digits in hexadecimal 1, 12, and 123.

In short, the first n - 1 p's can be expressed, in numerals to base n, in terms of ascending digits starting with 1, 12, etc. Let's prove that.

[MATH]p_1 = np_0 + 1 = n(0) + 1 = 1 = n^0 * 1 = \left ( \sum{i=1}^1 n^{(1-i)} * i \right ).[/MATH]
Thus, for any n > 2, there certainly is at least one positive digit j such that

[MATH]p_j = \left ( \sum_{i=1}^j n^{(j-i)} * i \right ).[/MATH]
[MATH]p_{j+1} = np_j + (j + 1) = np_j + n^0 * (j + 1)= n \left ( \sum{i=1}^j n^{(j-i)} * i \right) + n^0 * (j + 1) =[/MATH]
[MATH]\left ( \sum_{i=1}^j n^{\{1 + (j - i)\}} * i \right ) + n^{\{(j+1)-(j+1)\}} * (j + 1) = \left ( \sum_{i=1}^{j + 1}n^{\{(j+1)-i\}} * i \right ).[/MATH]
So, by induction, [MATH]p_k = \left ( \sum_{i=1}^k n^{(k-i)} * i \right ).[/MATH]
But that is how we create base n notation.

Let's look at the first three q's. For examples, refer back to p values.

[MATH]n = 8 \implies q_1 = (8 - 2)(1) + 1 = 7 = 8^0 * 7,\ q_2 = 6(10) + 2 = 62 = 8^1 * 7 + 8^0 * 6,[/MATH]
[MATH]q_3 = 6(83) + 3 = 501 = 8^2(7) + 8^1(6) + 8^0(5).[/MATH]
In octal, those are 7, 76, and 765 respectively. Octal digits in reverse order.

[MATH]n = 10 \implies q_1 = 8(1) + 1 = 9,\ q_2 = 8(12) + 2 = 98,\ 8(123)) + 3 = 984 + 3 = 987.[/MATH]
Decimal digits in reverse order.

[MATH]n = 16 \implies q_1 = 14(1) + 1 = 15 = F_{16},\ q_2 = 14(18) + 2 = 254 = 15 * 16 + 14 = FE_{16},[/MATH]
[MATH]q_3 = 14(291) + 3 = 4077 = 3840 + 224 + 13 = 15 * 16^2 + 14 * 16 + 13 = FED_{16}.[/MATH]
Hexadecimal digits in reverse order.

In short, the first n - 1 q's can be expressed, in numerals to base n, in terms of descending digits starting with n - 1. Let's prove that.

[MATH]q_1 = (n - 2)p_1 + 1 = (n - 2)(1) + 1 = n - 2 + 1 = n - 1 = (n - 1)n^0 = \left ( \sum_{i=1}^1 (n - i) * n^{(1 - i)} \right ).[/MATH]
Thus, we can certainly say that, for any n > 2, there exists at least one positive integer j such that

[MATH]q_j = \left ( \sum{i=1}^j (n - i) * n^{(j-i)} \right ).[/MATH]
Moreover we can say in general that

[MATH]p_j(n - 2) + j = q_j \implies p_j = \dfrac{q_j - j}{n - 2}.[/MATH]
It was important to restrict n > 2.

[MATH]\therefore p_{j+1} = np_j + (j + 1) = \dfrac{nq_j - nj}{n - 2} + j + 1.[/MATH]
[MATH]\therefore q_{j+1} = (n - 2)p_{j+1} + (j +1) = (n - 2) \left ( \dfrac{nq_j - nj}{n - 2} + j + 1 \right ) + j + 1 =[/MATH]
[MATH]nq_j - nj + (n - 2)(j + 1) + (j + 1) = nq_j - nj + nj + n - 2j - 2 + j + 1 = nq_j + n - 1 - j = nq_j + \{n - (j + 1)\}=[/MATH]
[MATH]n \left ( \sum_{i=1}^j (n - i) * n^{(j-i)} \right ) + \{n - (j + 1)\} = \left ( \sum_{i=1}^j (n - i) * n^{\{(j+1)-i\}} \right ) + \{n - (j + 1)\} * n^\{(j+1)-(j+1)\} =[/MATH]
[MATH]\left ( \sum_{i=1}^{j+1} (n - i) * n^{\{(j+1)-i\}} \right ).[/MATH]
So, by induction, [MATH]q_k = \left ( \sum_{i=1}^k (n - i) * n^{(k-i)} \right ).[/MATH]
But that is how we create base n notation.
 
Last edited:
Upon rereading my post from yesterday, I realize that it may be psychologically unsatisfactory. Of course, ultimately, all that counts is logic, which I hope I provided yesterday. What is interesting about the pattern, which was what was asked about, is that the multiplicand in line t has the digits in ascending order and the resultant has the digits in descending order.

The formula, which appears to involve only one independent variable, is the same in each step, and, except for the first step, the value of the independent variable used in step s is fully determined by the value of the independent variable used in step s - 1. So ultimately everyting is determined by the value for the independent variable used in step 1, but let's ignore that for the moment. Let's consider the actual case where we are dealing with numbers represented in decimal notation.

Our formula in step s is [MATH]8x + s = y.[/MATH] Note 1 < s < 10.

Our formula in step s - 1 is [MATH]8u + (s - 1) = v.[/MATH]
The obvious relation between u and x is [MATH]x = 10u + s.[/MATH]
Now, provided that s is an integer such that [MATH]1 < s < 10,[/MATH]
the units digit of x in decimal notation will be s regardless of what positive integer equals u.

10 * 346 + 2 = 3460 + 2 = 3462. This is a consequence of place value.

Again, regardless of what positive integer u is,

[MATH]8u + (s - 1) = v \implies 8u = v + 1 - s \implies u = \dfrac{v + 1 - s}{8}.[/MATH]
[MATH]x = 10u + s = 10 * \dfrac{v + 1 - s}{8} + s = \dfrac{10v + 10 - 10s}{8} + s = \dfrac{10v + 10 - 2s}{8}.[/MATH]
[MATH]y = 8x + s = 8 * \dfrac{10v + 10 - 2s}{8} + s = 10v + 10 - 2s + s = 10v + (10 - s)).[/MATH]
Provided that s is an integer such that

[MATH]1 < s < 10 \implies -\ 10 < -\ s < -\ 1 \implies 0 < 10 - s < 9.[/MATH]
So no matter what v is, the low order digit in step s will be 10 - s.

745 * 10 + (10 - 4) = 7450 + 6 = 7456.

But of course the pattern continues in each step because we never put a specific value on s. So does the pattern work for the first step?

8 * 1 + 1 = 9 = 10 - 1. It does.

Now yesterday I went far afield to show that there are similar formulas that work for any place value system of numeration (other than binary). If that obscured things, I apolgize,
 
Thanks for giving this so much time. I admit your first explanation did get my head hurting a little and your second approach is making more sense to me! Still looking over your ideas!
 
Top