8 3 = 5 1 2 ⇒ 5 + 1 + 2 = 8
Let us define the function S k ( n ) as the digit sum of the number n k where n , k ∈ N . Shown above is an example of when S k ( n ) = n . For each given k , there are a finite number of n such that S k ( n ) = n . In fact, sometimes for a given k there are sets A = { a 1 , a 2 , . . . a n } such that the following property holds:
S k ( a 1 ) = a 2 , S k ( a 2 ) = a 3 , … , S k ( a n ) = a 1
An example of a set with this property would be A = { 1 3 , 1 6 } for k = 2 .
1 3 2 = 1 6 9 ⇒ 1 + 6 + 9 = 1 6 1 6 2 = 2 5 6 ⇒ 2 + 5 + 6 = 1 3
Let us define U k as the multiset of all sets A such that the above property holds for a given k . What is the minimum possible number of sets that U k could contain?
Details and Assumptions :
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.
Problem Loading...
Note Loading...
Set Loading...
The key to the solution is to realize that digit sums are conserved under modular arithmetic mod 9 . This means that S k ( n ) ≡ n k (mod 9 ) . Let's make a chart for n k (mod 9 ) for the first few values of k .
As you can see, the pattern repeats after every multiple of 6 , so we only need to consider the first 6 values of k , a
k ≡ 1 (mod 6 ) :
Here, we can see from the chart that if n is coprime to 9 , then S k ( n ) ≡ n (mod 9 ) , therefore we must have at least 7 sets in U k , and U k must have the following form (mod 9 ):
{ [ 0 ] , [ 1 ] , [ 2 ] , [ 4 ] , [ 5 ] , [ 7 ] , [ 8 ] } ⟹ If k ≡ 2 (mod 6 ) , Minimum = 7
k ≡ 2 (mod 6 ) :
Here, S k ( n ) can only be 0 , 1 , 4 , or 7 (mod 9 ). We can also see that if n ≡ 4 (mod 6 ) then S k ( n ) ≡ 7 (mod 6 ) , and if n ≡ 7 (mod 6 ) then S k ( n ) ≡ 4 (mod 6 ) , so we have the possible configuration for U k :
{ [ 0 ] , [ 1 ] , [ 4 , 7 ] } ⟹ If k ≡ 2 (mod 6 ) , Minimum = 3
k ≡ 3 (mod 6 ) :
The chart shows that S k ( n ) ∈ { 0 , 1 , 8 } , and each number maps to itself under the function S k ( n ) , meaning that U k has the form:
{ [ 0 ] , [ 1 ] , [ 8 ] } ⟹ If k ≡ 2 (mod 6 ) , Minimum = 3
k ≡ 4 (mod 6 ) :
This configuration is nearly identical to when k ≡ 2 (mod 6 ) . The only possibilities for S k ( n ) are 0 , 1 , 4 , or 7 (mod 9 ), 0 and 1 map to themselves, 4 maps to 7 and 7 maps back to 4 , giving us the possible arrangement for U k :
{ [ 0 ] , [ 1 ] , [ 4 , 7 ] } ⟹ If k ≡ 2 (mod 6 ) , Minimum = 3
k ≡ 5 (mod 6 ) :
Like when k ≡ 1 (mod 6 ) , S k ( n ) can assume the values 0 , 1 , 2 , 4 , 5 , 7 or 8 (mod 9 ). Unlike when k ≡ 1 (mod 6 ) , not all the numbers map to themselves under S k ( n ) . 0 , 1 and 8 map to themselves, while 2 and 5 form a pair, as well as 4 and 7 . This leads to the following configuration of U k :
{ [ 0 ] , [ 1 ] , [ 8 ] , [ 2 , 5 ] , [ 4 , 7 ] } ⟹ If k ≡ 2 (mod 6 ) , Minimum = 5
k ≡ 0 (mod 6 ) :
It's easy to see that this will be our minimum. S k ( n ) can only have the values 0 and 1 , and each number maps to itself, leading to the minimum configuration for U k :
{ [ 0 ] , [ 1 ] } ⟹ If k ≡ 2 (mod 6 ) , Minimum = 2
As you can see, when k ≡ 0 (mod 6 ) , U k can contain a minimum of just 2 sets, where as for other values of k it must contain more, therefore our final answer must be 2 .
Note: a lot of these congruences can also be proven by using Euler's Theorem, n ϕ ( a ) m ≡ 1 (mod a ) , where n , m and a are positive integers, n and a are coprime and ϕ ( a ) is the Euler totient function. Setting a = 9 , ϕ ( 9 ) = 6 , therefore we have the congruence n 6 m ≡ 1 (mod 9 ) , which can be seen in our minimum solution above.