It's more common than you think

For positive integer n n , define M n M_n as an n n -digit positive integer such that in decimal representation, the last n n (rightmost) digits of M n 2 M_n^2 is M n M_n itself. Denote L n L_n as the sum of all possible values of M n M_n . Find the 14th smallest integer k k that doesn't satisfy the equation L k = 1 0 k + 1 L_k=10^k+1 .

Details and Assumptions :

  • As an explicit example: If n = 3 n=3 , then M 3 = 376 , 625 M_3 = 376,625 because 37 6 2 = 141 376 376^2=141\underline{376} and 62 5 2 = 390 625 625^2=390\underline{625} and then L 3 = 1 0 3 + 1 L_3=10^3+1 but if n = 4 n=4 , M 4 = 9376 M_4=9376 only, so L 4 1 0 4 + 1 L_4\ne10^4+1 .

  • I don't consider k = 1 k=1 as the smallest integer k k that doesn't satisfy the equation L k = 1 0 k + 1 L_k = 10^k+1 .

Inspiration: This question that inspired this question .


The answer is 40.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Garrett Clarke
Jul 18, 2015

There are two infinite sequences of numbers { a n } \{a_n\} and { b n } \{b_n\} where a k 2 a k a_k^2\equiv a_k (mod 1 0 k 10^k ) and b k 2 b k b_k^2\equiv b_k (mod 1 0 k 10^k ). For every value of n 1 n\geq1 , the satisfy the following equation:

k = 1 n 1 0 k 1 ( a k + b k ) = 1 0 k + 1 \displaystyle \sum_{k=1}^{n} 10^{k-1}(a_k+b_k)=10^k+1

By analyzing this equation we see that a k + b k = 9 a_k+b_k=9 for n > 1 n>1 . If a k a_k or b k b_k equal 0 0 , then M n M_n will only have one solution, and therefore will not satisfy they equation L k = 1 0 k + 1 L_k=10^k+1 . We need to find an algorithm that will find count the number of times that a k a_k or b k b_k equals 0 0 . There is a fairly simple method to find subsequent values of a k a_k where a 1 = 5 a_1=5 . Using a k + b k = 9 a_k+b_k=9 , we must now count when a k { 0 , 9 } a_k\in\{0,9\} .

We define A n A_n as the following, relate it to our sequence a n {a_n} , and use the following equations and congruences to build our algorithm.

A n = k = 1 n a k 1 0 k 1 A_n=\displaystyle \sum_{k=1}^{n} a_k10^{k-1}

( A n 2 A n ) 1 0 k a n + 1 (mod 10 ) (A_n^2-A_n)10^{-k}\equiv a_{n+1} \text{ (mod }10)

A n + 1 = a n + 1 1 0 n + A n A_{n+1}=a_{n+1}10^n+A_n

Using these formulas I was able determine each value of k k such that a k { 0 , 9 } a_k\in\{0,9\} . Here's an example of how it works:

a 1 = 5 a_1=5 , a 2 = 2 a_2=2 , A 2 = 5 ( 1 0 0 ) + 2 ( 1 0 1 ) = 25 A_2=5(10^0)+2(10^1)=25

2 5 2 25 1 0 2 = 6 6 (mod 10 ) a 3 = 6 \frac{25^2-25}{10^2} = 6\equiv 6 \text{ (mod }10) \Longrightarrow a_3=6

A 3 = 6 ( 1 0 2 ) + 25 = 625 A_3=6(10^2)+25=625

Save the value of A n A_n and check values of a n + 1 a_{n+1} at every iteration.

Here is the list I came up with using this algorithm:

4 , 5 , 12 , 13 , 20 , 24 , 25 , 29 , 32 , 33 , 34 , 35 , 38 , 40 4,5,12,13,20,24,25,29,32,33,34,35,38,40

Notice that k = 1 k=1 is also a non-solution as M n = 1 , 5 , 6 L k = 1 + 5 + 6 = 12 > 1 0 1 + 1 M_n = {1,5,6} \Longrightarrow L_k=1+5+6=12>10^1+1

Assuming that Pi Han Goh doesn't count k = 1 k=1 as a solution, the 14 14 th value of k k in this list is 40 \boxed{40}

Kartik Sharma
Jun 19, 2015

All I can say is

this

and

this

and for a ( n ) = 0 , n + 1 a(n) = 0, n+1 is your k k . Count till 14 14 .

Still I would love if anybody gives a number theoretical approach. How did mathematicians came up with that table and that for others, there will only 2 2 automorphic numbers and that too adding to 10 k + 1 {10}^{k} +1

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...