Let be a function defined on the non-negative integers given the following facts:
.
For , gives the smallest positive integer, which does not divide .
Let , find .
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.
This question should probably be posted in the Number Theory section since it deals mainly with property of divisibility.
Let's write out a few values of f ( n ) . We will need them later for reference.
f ( 0 ) = 0 , f ( 1 ) = 0 , f ( 2 ) = 1 , f ( 3 ) = 2 , f ( 4 ) = 3 , f ( 5 ) = 2 , f ( 6 ) = 4 , f ( 7 ) = 2 , f ( 8 ) = 3 .
If n is an odd number, then f ( n ) = 2 , so g ( n ) = f ( f ( f ( n ) ) ) = f ( f ( 2 ) ) = f ( 1 ) = 0 .
Therefore, n = 1 ∑ 2 0 1 6 g ( n ) = g ( 2 ) + g ( 4 ) + g ( 6 ) + ⋯ + g ( 2 0 1 6 ) .
To organize my solution, I will form a sequence which comprise the numbers 2 , 4 , 6 ⋯ , 2 0 1 6 and remove numbers which are not divisible by 3 after computing the sum of g ( n ) for such numbers. Then, rinse and repeat for 4 , 5 ⋯
Note that there are 1 0 0 8 numbers in the sequence 2 , 4 , 6 , ⋯ , 2 0 1 6 . Out of these, 3 2 0 1 6 = 3 3 6 are divisible by 3 , while 6 7 2 are not. For these 6 7 2 numbers, with the exception of g ( 2 ) = f ( f ( f ( 2 ) ) ) = f ( f ( 1 ) ) = f ( 0 ) = 0 , we have f ( n ) = 3 , which implies g ( n ) = f ( f ( 3 ) ) = f ( 2 ) = 1 . These g ( n ) sum up to 6 7 1 .
Out of the remaining 3 3 6 numbers in the sequence 6 , 1 2 , 1 8 ⋯ , 2 0 1 6 , we find that 2 3 3 6 = 1 6 8 are divisible by 4 while the other 1 6 8 aren't. For these 1 6 8 numbers which aren't divisible by 4 , we have f ( n ) = 4 , which implies g ( n ) = f ( f ( 4 ) ) = f ( 3 ) = 2 . These g ( n ) sum up to 2 . 1 6 8 = 3 3 6 .
Now, 1 6 8 numbers ( 1 2 , 2 4 , ⋯ , 2 0 1 6 ) remain in our sequence. Out of these, only 3 3 , namely 6 0 , 1 2 0 , ⋯ , 1 9 8 0 are divisible by 5 while the other 1 3 5 aren't. For these 1 3 5 numbers, we have f ( n ) = 5 , which implies g ( n ) = f ( f ( 5 ) ) = f ( 2 ) = 1 . These g ( n ) sum up to 1 3 5 .
All the 3 3 numbers remaining in the sequence are divisible by 6 since they are divisible by both 2 and 3 . Therefore, we focus our attention on divisibility by 7 .
It is easy to see that only 4 members in the sequence are divisible by 7 , which are 4 2 0 , 8 4 0 , 1 2 6 0 and 1 6 8 0 . For the remaining 2 9 which aren't divisible by 7 , we have f ( n ) = 7 , which implies g ( n ) = f ( f ( 7 ) ) = f ( 2 ) = 1 . These g ( n ) sum up to 2 9 .
It is easy to see that f ( 4 2 0 ) = f ( 1 2 6 0 ) = 8 , while f ( 8 4 0 ) = f ( 1 6 8 0 ) = 9 . Therefore, g ( 4 2 0 ) = g ( 1 2 6 0 ) = f ( f ( 8 ) ) = f ( 3 ) = 2 while g ( 8 4 0 ) = g ( 1 6 8 0 ) = f ( f ( 9 ) ) = f ( 2 ) = 1 . Summing these g ( n ) up, we get 6 .
The answer follows from 6 7 1 + 3 3 6 + 1 3 5 + 2 9 + 6 = 1 1 7 7 .