Let be a prime. Suppose that the number of ways to place indistinguishable red marbles, indistinguishable green marbles, and indistinguishable blue marbles around a circle such that no red marble is next to a green marble and no blue marble is next to a blue marble is . (Rotations and reflections of the same configuration are considered distinct.) Given that , where is a non-negative integer and is not divisible by , and is the remainder of when divided by , compute .
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.
The ordering will look like groups of red marbles and green marbles where each group is separated by a blue marble. Let k be the number of red groups and summing over 1 ≤ k ≤ p − 1 , we have N = 3 k = 1 ∑ p − 1 ( k − 1 p − 1 ) ( k p − 1 ) ( k p ) = 3 p k = 1 ∑ p − 1 k 1 ( k − 1 p − 1 ) 2 ( k p − 1 ) . Furthermore, k = 1 ∑ p − 1 k 1 ( k − 1 p − 1 ) 2 ( k p − 1 ) ≡ k = 1 ∑ p − 1 k ( − 1 ) k ≡ − k = 1 ∑ p − 1 k 1 ( k − 1 p − 1 ) ≡ p 2 − 2 p ( m o d p ) So, m = 1 and r ≡ p 3 ( 2 − 2 p ) ≡ 1 8 9 6 ( m o d p ) . Hence, the answer is 2 0 1 7 + 1 8 9 6 = 3 9 1 3