It's the magic number!

Hey! In this note I'm going to talk about a very cool pattern... in the case of 3, observe the sequence below:

P0=3P1=3P0=27P2=3P1=...84987P3=3P2=...39387P4=3P3=...55387P5=3P4=...95387P6=3P5=...95387\displaystyle { P }_{ 0 }=3\\ { P }_{ 1 }={ 3 }^{ { P }_{ 0 } }=27\\ { P }_{ 2 }={ 3 }^{ { P }_{ 1 } }=...84987\\ { P }_{ 3 }={ 3 }^{ { P }_{ 2 } }=...39387\\ { P }_{ 4 }={ 3 }^{ { P }_{ 3 } }=...55387\\ { P }_{ 5 }={ 3 }^{ { P }_{ 4 } }=...95387\\ { P }_{ 6 }={ 3 }^{ { P }_{ 5 } }=...95387

Notice that the digits at the end stay the same! In fact, we add one "fixed" digit every time. The cool part is that this works for every natural number coprime to 1000 - which also implies it works for any prime greater than 5, and that this works 40% of the time! (ϕ(1000)=400\phi(1000)=400) In this note I'm only covering the special case where Pk{P}_{k} has kk fixed digits -- there are other cases, such as when you use 5, that grow far more quickly.

The first step is to show that if aa is coprime to 1000 then

a1001(mod1000)\displaystyle {a}^{100} \equiv 1 \pmod {1000}

This is justified because λ(1000)=100\lambda(1000)=100, where λ(n)\lambda(n) is the Carmichael function which gives the minimum value (for where 100 is) for the equation above. Now, let a100=1000b+1{a}^{100}=1000b+1. Let's compute a1000{a}^{1000}:

(1000b+1)10=(1010)+(109)1000b...\displaystyle {\left(1000b+1\right)}^{10} = \binom{ 10 }{ 10 }+\binom{ 10 }{ 9 }1000b...

We now have that a10001(mod10000){a}^{1000} \equiv 1 \pmod {10000}, and we can induct to show that a10n1(mod10n+1){a}^{{10}^{n}} \equiv 1 \pmod {{10}^{n+1}}.

In this section I'll use jj as a number coprime to 1000. Let Dn{D}_{n} be the nth{n}^{th} digit of Pk{P}_{k}, and let dd be the number of digits in Pk{P}_{k}. Observe that

Pk+1=i=1dj10diDdi\displaystyle { P }_{ k+1 }=\prod _{ i=1 }^{ d }{ { j }^{ { 10 }^{ d-i }{ D }_{ d-i } } }

Using our previous result, if we evaluate mod 10k+1{10}^{k+1}, a lot of terms will just become 1 and can be ignored. So we get a new product:

Pk+1=i=1kj10kiDki(mod10k+1)\displaystyle { P }_{ k+1 }=\prod _{ i=1 }^{ k }{ { j }^{ { 10 }^{ k-i }{ D }_{ k-i } } } \pmod {{ 10 }^{ k+1 }}

Okay, so really we only care about the last kk digits of Pk{P}_{k} if we're finding the last k+1k+1 digits of Pk+1{P}_{k+1}. (Specifically we raise j to Pk{P}_{k} in mod 10k{10}^{k})

Now I can prove the conjecture about the last digits (by induction). The base case is easy, so I'll leap right into showing that the next Pk+1{P}_{k+1} has k+1k+1 fixed digits.

First, we assume that the last kk digits of Pk{P}_{k} are fixed. This means we only need to show that we add another fixed digit in Pk+1{P}_{k+1}. For this part, let aPk(mod10k)a \equiv {P}_{k} \pmod {{10}^{k}} and let bb be the k+1thk+{1}^{th} digit from the end of Pk+1{P}_{k+1}. We want to show that:

j10kb+a10kb+a(mod10k+1)\displaystyle { j }^{ { 10 }^{ k }b+a }\equiv { 10 }^{ k }b+a \pmod {{10}^{k+1}}

which essentially says that the last k+1k+1 digits of Pk{P}_{k} will be the last k+1k+1 digits of all later terms in the series. The two finds I made earlier make this very easy:

(j10k)bja10kb+a(mod10)k+1\displaystyle { \left( { j }^{ { 10 }^{ k } } \right) }^{ b }{ j }^{ a }\equiv { 10 }^{ k }b+a{ \pmod { 10 }^{ k+1 } }

which we may reduce to

ja10kb+a(mod10)k+1\displaystyle { j }^{ a }\equiv { 10 }^{ k }b+a{ \pmod { 10 }^{ k+1 } }

We know from earlier that ja{j}^{a} will give Pk+1(mod10k+1){P}_{k+1} \pmod {{10}^{k+1}}, and by definition Pk+110kb+a(mod10k+1){P}_{k+1} \equiv {10}^{k}b+a \pmod {{10}^{k+1}}. Thus the statement we started with is true, and we're done!

Please comment if you have any questions/concerns or any further ideas!

Note by Dylan Pentland
4 years, 8 months ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link]( link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}


Sort by:

Top Newest

Yes, this makes good sense! Beautiful!

That's how I think of it: For the Carmichael Lambda we have λ(10m)10m1\lambda(10^m)|10^{m-1} for m3m\geq{3} . Also, λ(100)=20,λ(20)=4\lambda(100)=20,\lambda(20)=4 and λ(4)=2\lambda(4)=2.

Thus, for an odd integer aa, we can "work our way up" as follows: a1(mod2)a\equiv1\pmod2 , so aaa(mod4)a^a\equiv a \pmod4 so aaaaa(mod20)a^{a^a}\equiv{a^a}\pmod{20} so aaaaaaa(mod100)a^{a^{a^a}}\equiv{a^{a^a}}\pmod{100} and m+1ama(mod10m1)^{m+1}a\equiv{^m{a}}\pmod{10^{m-1}} for all positive integers mm.

Otto Bretscher - 4 years, 8 months ago

Log in to reply

Cool! Do you have any ideas on how the resulting series of fixed digits could be found? I'm trying to find some patterns in them but haven't found anything yet...

Dylan Pentland - 4 years, 8 months ago

Log in to reply

I'm sure you will figure it out ;) Enjoy!

Otto Bretscher - 4 years, 8 months ago

Log in to reply

This looks interesting! Thank you for sharing!

It is not hard to see that, for any two positive integers bb and nn, the "power tower" mb=bbb...^m{b}=b^{b^{b^{...}}} eventually becomes stationary modulo nn. We can prove this by induction on nn; let's assume the claim to be true for integers <n<n . Then the exponent m1b^{m-1}b of our power tower will eventually become stationary modulo ϕ(n)\phi(n) , so that the whole tower will become stationary modulo nn by Euler's Theorem.

In your article, you quantify the "eventually" part of this statement in some cases... I look forward to studying the details when I have some free time.

Otto Bretscher - 4 years, 8 months ago

Log in to reply

I think there is a typo you said let a^100=1000b+1 and then took a^1000=(1000b+1)^1000.

shivamani patil - 4 years, 7 months ago

Log in to reply

Yeah, I meant to raise it to the 10th. But, the proof still works :)

Dylan Pentland - 4 years, 7 months ago

Log in to reply

Ya worked.BTW great work.Keep it up. xD

shivamani patil - 4 years, 7 months ago

Log in to reply

I used your note as an inspiration fore one of my Problems. Thanks! Basically, it's about your P2P_2 and P3P_3 in the even case.... when do they end with the same digit? You have probably thought about this already...

Otto Bretscher - 4 years, 7 months ago

Log in to reply


Mona Sax - 4 years, 6 months ago

Log in to reply


Problem Loading...

Note Loading...

Set Loading...