We call a positive integer n a beautiful number if there exists a permutation a 1 , . . . , a n of 1 , . . . , n such that { a 1 − 1 , a 2 − 2 , a 3 − 3 , . . . , a n − n } and { a 1 + 1 , . . . , a n + n } are both equivalent to { 1 , 2 , . . . , n } modulo n . How many beautiful numbers are there between 1 and 1000 (inclusive)?
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.
For an integer n , suppose k is an integer coprime to n . Then we claim that the sequence { k ( 1 ) , k ( 2 ) , k ( 3 ) , ⋯ , k ( n ) } = { k i } i = 1 n ≡ { i } i = 1 n = { 1 , 2 , 3 , ⋯ , n } ( m o d n ) . This claim is true because for any i ∈ { 1 , 2 , ⋯ , n − 1 } , we have k ( i + 1 ) − k ( i ) = k which is coprime to n , and hence whatever the value of k ( 1 ) ( m o d n ) is, the sequence { k i } i = 1 n = { k ( 1 ) + k ( i ) } i = 0 n − 1 traces out all values modulo n .
The question states { a 1 , a 2 , a 3 , ⋯ , a n } ≡ { a 1 − 1 , a 2 − 2 , a 3 − 3 , ⋯ , a n − n } ≡ { a 1 + 1 , a 2 + 2 , a 3 + 3 , ⋯ , a n + n } . By the above lemma, this implies there must exist 3 consecutive integers, that are coprime to n which implies g cd ( n , 6 ) = 1 . Precisely, there are 3 3 3 such integers less than 1 0 0 0 .
Problem Loading...
Note Loading...
Set Loading...
My Solution:
The answer is 333. The beautiful numbers are only the ones coprime with 6, and from this we easily get the answer. Now we must prove the beautiful numbers are the ones coprime with 6.
First, assume n is coprime with 6. Then call p 1 = 1 , p 3 = 2 , p 5 = 3 , ..., p n = ( n + 1 ) / 2 , and then call p 2 = ( ( n + 1 ) / 2 ) + 1 , p 4 = p 2 + 1 , ..., p n − 1 = n . We can easily verify that { p 1 − 1 , . . . , p n − 1 } is equivalent to { 0 , ( n − 1 ) / 2 , − 1 , ( n − 3 ) / 2 , − 2 , . . . , 1 , − ( n − 1 ) / 2 } ≡ { 1 , 2 , . . . , n } and so it works. Also, we can verify that { p 1 + 1 , . . . , p n + 1 } is an arithmetic progression (not in order) that starts with 2 and has common difference 3, and so it also works.
Now we must prove numbers divisible by 2 or 3 don't work.
If n works, then p 1 + . . . + p n ≡ p 1 − 1 + p 2 − 2 + . . . + p n − n mod n , therefore n ∣ 1 + . . . + n = n ( n + 1 ) / 2 and so clearly n is odd.
Also, note that 2 n ( n + 1 ) ( 2 n + 1 ) / 3 = 4 ( 1 2 + . . . + n 2 ) ≡ 2 ( ( p 1 2 + 1 2 ) + . . . + ( p n 2 + n 2 ) ) = ( ( p 1 − 1 ) 2 + ( p 1 + 1 ) 2 ) + . . . + ( ( p n − n ) 2 + ( p n + n ) 2 ) ≡ 2 ( 1 2 + . . . + n 2 ) = n ( n + 1 ) ( 2 n + 1 ) / 3 mod n . From this, n ∣ n ( n + 1 ) ( 2 n + 1 ) / 3 and so ( n + 1 ) ( 2 n + 1 ) / 3 is an integer, and therefore clearly n cannot me a multiple of 3.
So beautiful numbers are the ones coprime with 6 and the answer is 333.