How many positive integers n ≤ 1 0 0 0 are there which satisfy the following condition:
We can rearrange the positive integers from 1 to n in a row, where the sum of the first k terms is not a multiple of 3, for every 1 ≤ k < n .
Note: To avoid ambiguity, the integer 1 satisfies the above condition.
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.
Nice explanation. (I'm going to use that as an excuse for not writing up my own explanation. :) )
One comment: I think that it would still work if you made a k = k + 1 for 1 < k < n (still keeping a 1 = 1 and a n = 2 ). That seems to be the simplest pattern that works, i.e. 1 , 3 , 4 , 5 , . . . , n , 2 .
Log in to reply
P.S. So the sum of the first k terms, for k < n , is
( k + 1 ) ( k + 2 ) / 2 − 2
which is equivalent in m o d 3 to either − 2 or 1 − 2 = − 1 as desired.
The sequence is
1
1 2
1 3 2
1 3 4 2
1 3 4 2 5
1 3 4 2 6 5
1 3 4 2 6 7 5
1 3 4 2 6 7 5 8
1 3 4 2 6 7 5 9 8
1 3 4 2 6 7 5 9 10 8
1 3 4 2 6 7 5 9 10 8 11
1 3 4 2 6 7 5 9 10 8 12 11
1 3 4 2 6 7 5 9 10 8 12 13 11
1 3 4 2 6 7 5 9 10 8 12 13 11 14
Problem Loading...
Note Loading...
Set Loading...
Let m = ⌊ 3 n ⌋ .
Then we can arrange the numbers as follows, into the sequence ( a r ) : a r = ⎩ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎧ 1 ⌈ 2 3 r + 1 ⌉ 3 ( r − n + m + 1 ) 2 : r = 1 : 2 ≤ r ≤ n − m − 1 : n − m ≤ r ≤ n − 1 : r = n
It is easily verifiable that this sequence contains each number from 1 to n exactly once;
Define S r = ∑ i = 1 r a i . Notice that the sequence starts with 1 , so S 1 = 1 . Then this is followed by a sequence which alternates between 1 ( m o d 3 ) and 2 ( m o d 3 ) . Hence, in this section S r alternates between 2 ( m o d 3 ) and 1 ( m o d 3 ) .
The third section contains only multiples of 3 , so in this section S r ≡ 1 ( m o d 3 ) . Hence S r ≡ 0 ( m o d 3 ) for 1 ≤ r < n .
Therefore, it is always possible to create such a sequence for all positive integers n .