Such a strange property

For a graph G G on n n vertices, let P G ( x ) P_G(x) be the unique polynomial of degree at most n n such that for each i = 0 , 1 , 2 , , n i = 0, 1, 2, \ldots, n , P G ( i ) P_G(i) equals the number of ways to color the vertices of the graph G G with i i distinct colors such that no two vertices connected by an edge have the same color. For each integer 3 k 2017 3 \leq k \leq 2017 , define a k k -strange graph to be a connected graph on 2017 2017 vertices with 2017 2017 edges and a cycle of length k k . Let the strangeness of a k k -strange graph G G be the number of coefficients in P G ( x ) P_G(x) that are odd integers, and let t t be the minimal strangeness over all k k -strange graphs with 3 k 2017 3 \leq k \leq 2017 .

Determine the sum of all integers b b between 3 3 and 2017 2017 inclusive for which there exists a b b -strange graph with strangeness t t .


The answer is 2022.

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.

1 solution

Ivan Koswara
Nov 11, 2017

P G P_G is the chromatic polynomial of G G , and it has the property that for any positive integer n n , P G ( n ) P_G(n) is precisely the number of ways to color G G using n n colors (so this is true for all positive integers, not only for up to V ( G ) |V(G)| as described in the problem statement).

For a k k -strange graph, the chromatic polynomial can be derived pretty easily. First, observe that any k k -strange graph has exactly one cycle, which is of length k k ; deleting any edge in this cycle gives a tree. Thus, P G P_G can be computed as follows. Consider any coloring of the cycle; then, starting from the cycle and moving outward, we color each of the remaining vertices. At any time, vertices not in this cycle have only 1 neighbor colored, and so given n n colors, we can color each vertex not in the cycle with n 1 n-1 remaining choices. Thus P G ( n ) = P C k ( n ) ( n 1 ) 2017 k P_G(n) = P_{C_k}(n) \cdot (n-1)^{2017-k} : the number of colorings for the cycle C k C_k , multiplied by ( n 1 ) 2017 k (n-1)^{2017-k} for the remaining vertices. P C k ( n ) = ( n 1 ) k + ( 1 ) k ( n 1 ) P_{C_k}(n) = (n-1)^k + (-1)^k (n-1) is well known, or otherwise it can be derived easily by induction. This yields P G ( n ) = ( n 1 ) 2017 + ( 1 ) k ( n 1 ) 2018 k P_G(n) = (n-1)^{2017} + (-1)^k (n-1)^{2018-k} .

We will now compute the number of odd coefficients in P G ( n ) P_G(n) . First, we take P G ( n ) ( m o d 2 ) = ( n + 1 ) 2017 + ( n + 1 ) 2018 k P_G(n) \pmod{2} = (n+1)^{2017} + (n+1)^{2018-k} ; odd coefficients in the original P G P_G translate to odd coefficients here, since we're taking modulo 2. Now, let ν 2 ( n ) \nu_2(n) be the highest exponent of the power of 2 that divides n n . It's well-known that ν 2 ( n ! ) = i = 1 n 2 i \nu_2(n!) = \sum_{i=1}^\infty \left\lfloor \frac{n}{2^i} \right\rfloor , and by using this on the binomial coefficient ( p q ) = p ! q ! ( p q ) ! \binom{p}{q} = \frac{p!}{q! (p-q)!} , we obtain that ( p q ) \binom{p}{q} is odd exactly when ν 2 ( ( p q ) ) = 0 \nu_2 \left( \binom{p}{q} \right) = 0 , which in turn happens when ν 2 ( p ! ) = ν 2 ( q ! ) + ν 2 ( ( p q ) ! ) \nu_2(p!) = \nu_2(q!) + \nu_2((p-q)!) . Substituting the formula and simplifying, noting that p 2 i q 2 i + p q 2 i \left\lfloor \frac{p}{2^i} \right\rfloor \ge \left\lfloor \frac{q}{2^i} \right\rfloor + \left\lfloor \frac{p-q}{2^i} \right\rfloor for all i i , the condition ν 2 ( p ! ) = ν 2 ( q ! ) + ν 2 ( ( p q ) ! ) \nu_2(p!) = \nu_2(q!) + \nu_2((p-q)!) forces this inequality to be an equality for all i i . This happens exactly when, in the binary representation of q q , all set bits are also set in the binary representation of p p .

Note that 2017 = 1111110000 1 2 2017 = 11111100001_2 ; it has 7 set bits and 4 unset bits. Suppose 2018 k 2018-k has a + b a+b set bits, a a of them also set in 2017 and b b unset, and c + d c+d unset bits, c c of them set in 2017 and d d unset. For example, if k = 100 k = 100 , then 2018 k = 1918 = 1110111111 0 2 2018-k = 1918 = 11101111110_2 ; we have a = 5 , b = 4 , c = 2 , d = 0 a = 5, b = 4, c = 2, d = 0 . Clearly we have the condition a + c = 7 , b + d = 4 a+c = 7, b+d = 4 . Now consider the coefficient of n i n^i in ( n + 1 ) 2017 + ( n + 1 ) 2018 k (n+1)^{2017} + (n+1)^{2018-k} . We have the following, based on the binary representation of i i :

  • If all set bits in i i are also set in 2017 and in 2018 k 2018-k , then both ( n + 1 ) 2017 (n+1)^{2017} and ( n + 1 ) 2018 k (n+1)^{2018-k} have odd coefficients for n i n^i , and they add up to even.
  • If all set bits in i i are also set in 2017, but not in 2018 k 2018-k , then only ( n + 1 ) 2017 (n+1)^{2017} has odd coefficient for n i n^i ; ( n + 1 ) 2018 k (n+1)^{2018-k} has even coefficient, and they add up to odd. This can happen in ( 2 c 1 ) 2 a (2^c-1) \cdot 2^a ways: we must pick at least one set bit among the c c that are set in 2017 but not in 2018 k 2018-k , and we can pick any combination of set bits among the a a that are set in 2017 and 2018 k 2018-k .
  • If all set bits in i i are set in 2018 k 2018-k but not in 2017, the coefficient ends up odd. There are ( 2 b 1 ) 2 a (2^b-1) \cdot 2^a ways this can happen.
  • If not all set bits in i i are also set in 2017, and neither in 2018 k 2018-k , the coefficient ends up even.

The number of odd coefficients in ( n + 1 ) 2017 + ( n + 1 ) 2018 k (n+1)^{2017} + (n+1)^{2018-k} is thus 2 a + b + 2 a + c 2 a + 1 2^{a+b} + 2^{a+c} - 2^{a+1} . We want to minimize this value. We know that a + c = 7 a+c = 7 ; thus, to minimize this value, we want a a as large as possible and b b as small as possible. Of course, this would have been satisfied by a = 7 , b = 0 , c = 0 a = 7, b = 0, c = 0 , but then 2018 k = 2017 2018-k = 2017 and so k = 1 k = 1 , impossible. Thus we'll have to do with the second smallest: a = 6 , b = 0 , c = 1 a = 6, b = 0, c = 1 . This means 2018 k 2018-k has 6 of the 7 set bits in 2017. This cannot be the last bit, as that means 2018 k = 2017 1 2018-k = 2017-1 or k = 2 k = 2 , also incorrect. But we can choose any of the other six bits: 2018 k = 2017 2 i 2018-k = 2017-2^i for any choice of i { 5 , 6 , 7 , 8 , 9 , 10 } i \in \{5, 6, 7, 8, 9, 10\} . This means the sum of all k k is simply ( 2 5 + 1 ) + ( 2 6 + 1 ) + + ( 2 10 + 1 ) = 2022 (2^5+1) + (2^6+1) + \ldots + (2^{10}+1) = \boxed{2022} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...