2 The pattern of the positive power end number

Source: Internet
Author: User

2 positive Powers-2, 4, 8, 16, 32, 64, 128, 256, ...-at the end of the numbers follow an obvious rule: 2, 4, 8, 6, 2, 4, 8, 6, .... These 4 numbers are always going to loop. In addition to the last number there is a loop-actually the final m bit-a power of 2 starting at 2m. For example, there is a loop of length 20 for the last two digits starting at 04, and a loop of length 100 for the last 3 digits starting from 008.

In this article, I will show you why there are these loops, how long they are, how they are expressed in mathematical form, and how they are seen.

The loop at the end number

The bottom digit-the position-is the remainder of the decimal integer d after d/10. Equivalently, the end number is the result of the D mod 10, with the minimum non-negative-normal remainder-as the result of the Convention. Modulo operation, which is continuously superimposed to the power of 2, to get the last number of loops:

    1. ...

We start from 2, take 10 modulo, multiply by 2, then 10 modulo, and so on. This pattern will loop until a previous result-2 appears again in the fifth step-loop confirmation. This shows the number 2n, n≥1, the lowest number in four digits 2, 4, 8, and 6 cycles.

This cycle tells us that the power of the same 2 of the end number is correlated, and their exponent differs by 4:

    • Ends in 2: 21, 25, 29, 213, 217, ....
    • Ends in 4: 22, 26, 210, 214, 218, ....
    • Ends in 8: 23, 27, 211, 215, 219, ....
    • Ends in 6: 24, 28, 212, 216, 220, ....

You can use the exponential arithmetic rules to describe more succinctly, showing the top 4 of all the last numbers in the power of 2:

    • Ends in 2: 21 24k, or 21+4k, k≥0.
    • Ends in 4: 22 24k, or 22+4k, k≥0.
    • Ends in 8: 23 24k, or 23+4k, k≥0.
    • Ends in 6: 24 24k, or 24+4k, k≥0.

It is also possible to establish a connection to a power of 2 according to the results of the exponential 4 modulo:

    • Ends in 2:
    • Ends in 4:
    • Ends in 8:
    • Ends in 6:

It is easy to know that the number of the positive power of any 2 is a few. For example, the lowest number of 2319 is 8, because.

Last
Cycle in the last Digit of 2n, n≥1
Power of both (k≥0) Exponent (mod 4)Digit
21+4k 1 2
22+4k 2 4
23+4k 3 8
24+4k 0 6

Summary, the form tells us, if,.

The last two digits of the loop

A similar analysis, just for 100 modulo, shows the last two digits of the power of 2, starting from the beginning, the cycle time is:

Last
Cycle in the last of Digits of 2n, n≥2
Power of both (k≥0) Exponent (MoD)2 Digits
22+20k 2 04
23+20k 3 08
24+20k 4 16
25+20k 5 32
26+20k 6 64
27+20k 7 28
28+20k 8 56
29+20k 9 12
210+20k 10 24
211+20k 11 48
212+20k 12 96
213+20k 13 92
214+20k 14 84
215+20k 15 68
216+20k 16 36
217+20k 17 72
218+20k 18 44
219+20k 19 88
220+20k 0 76
221+20k 1 52
The last three-bit loop

In order to find the last three digits of the cycle, repeat the above process, 1000 modulo. The following shows the last three bits of the power of 2 , starting at the beginning of the cycle of 100:

Last
Cycle in the last three Digits of 2n, n≥3
Power of both (k≥0) Exponent (MoD)3 Digits
23+100k 3 008
24+100k 4 11W
25+100k 5 032
26+100k 6 064
27+100k 7 128
28+100k 8 256
29+100k 9 512
210+100k 10 024
211+100k 11 048
212+100k 12 096
213+100k 13 192
214+100k 14 384
215+100k 15 768
216+100k 16 536
217+100k 17 072
218+100k 18 144
219+100k 19 288
220+100k 20 576
221+100k 21st 152
222+100k 22 304
223+100k 23 608
224+100k 24 216
225+100k 25 432
226+100k 26 864
227+100k 27 728
228+100k 28 456
229+100k 29 912
230+100k 30 824
231+100k 31 34]
232+100k 32 296
233+100k 33 592
234+100k 34 184
235+100k 35 368
236+100k 36 736
237+100k 37 472
238+100k 38 944
239+100k 39 888
240+100k 40 776
241+100k 41 552
242+100k 42 104
243+100k 43 208
244+100k 44 416
245+100k 45 832
246+100k 46 664
247+100k 47 328
248+100k 48 656
249+100k 49 312
250+100k 50 624
251+100k 51 248
252+100k 52 496
253+100k 53 992
254+100k 54 984
255+100k 55 968
256+100k 56 936
257+100k 57 872
258+100k 58 744
259+100k 59 488
260+100k 60 976
261+100k 61 952
262+100k 62 904
263+100k 63 808
264+100k 64 616
265+100k 65 232
266+100k 66 464
267+100k 67 928
268+100k 68 856
269+100k 69 712
270+100k 70 424
271+100k 71 848
272+100k 72 696
273+100k 73 69W
274+100k 74 784
275+100k 75 568
276+100k 76 136
277+100k 77 272
278+100k 78 544
279+100k 79 088
280+100k 80 176
281+100k 81 65W
282+100k 82 704
283+100k 83 408
284+100k 84 816
285+100k 85 632
286+100k 86 264
287+100k 87 528
288+100k 88 15W
289+100k 89 112
290+100k 90 224
291+100k 91 448
292+100k 92 896
293+100k 93 792
294+100k 94 584
295+100k 95 168
296+100k 96 336
297+100k 97 672
298+100k 98 344
299+100k 99 688
2100+100k 0 376
2101+100k 1 752
2102+100k 2 504
End m-Number loop

2 of the positive power of the end of the M-bit cycle to the 10m, the cycle is 4 5m-1, starting at 2m. (The specific proof relates to number theory, beyond the scope of this article)

with
Cycle Length for number of ending Digits (1 to ten)
m Period (4 5m-1) starts
1 4 21st
2 20 22
3 100 23
4 500 24
5 2500 25
6 12500 26
7 62500 27
8 312500 28
9 1562500 29
10 7812500 210

Cycle growth is fast-exponential growth-so a list of m greater than 3 cannot be listed.

Looping nesting (Nesting of Cycles)

For the end m bit, m-1 bit, m-2 bit, ..., the last 1 bits of the loop, can be considered nested, although their starting point is staggered. You can align the smaller starting numbers by just 0.

For example, in the last three-bit loop with a length of 100, 5 times the length is 20 of the last two bits of the loop, each length is 20 of the last two-bit loop contains 5 times the last loop of length 4. You can find the lowest rule from 8 (two-bit), the last two-bit rule starts at 08 (one needs to be moved), and the last three-bit rule starts at 008 (no shift required).

The following table identifies the nested loops (all 100 rows are marked because only 100 of the 2 power-end three bits of a loop-are listed).

Nested 1-3 Digit ending Patterns from 2102

Explore the bottom loop with PARI/GP

I use PARI/GP to perform the above calculations and validations. Here are three examples:

  • List the top 20 last is a power of 2 of 2 :
    For (I=0,19,print ("2^", 1+4*i, ":", 2^ (1+4*i)))2^1:22^5:322^9:5122^13:81922^17:1310722^21:20971522^25: 335544322^29:5368709122^33:85899345922^37:1374389534722^41:21990232555522^45:351843720888322^49: 5629499534213122^53:90071992547409922^57:1441151880758558722^61:23058430092136939522^65:368934881474191032322^ 69:5902958103587056517122^73:94447329657392904273922^77:151115727451828646838272
  • list the last two-bit loops ('% ' returns the remainder, equivalent to modulo operation):
    For (I=2,21,print ("2^", I, "mod (+):", 2^i%))2^2 mod: 42^3 mod: 82^4 mod: 162^5 mod (100): 322 ^6 mod: 642^7 mod (+): 282^8 mod (+): 562^9 mod: 122^10 mod: 242^11 mod: 482^12 mod (+): 962^13 mod (+): 922^14 mod (+): 842^15 mod: 682^16 mod (+): 362^17 mod: 722^18 mod: 442^19 mod: 882^20 mod (10 0): 762^21 mod (100): 52

    (Number of units here no previous complement 0)

  • Print the lowest 1 to 10-digit cycle length :
    for (I=1,10,print (i, ":", 4*5^ (i-1)))1:42:203:1004:5005:25006:125007:625008:3125009:156250010:7812500

2 The pattern of the positive power end number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.