Define xi=0 or 1 depending on whether Ai is red or blue. For obtuse triangle Ai−aAiAi+b (vertex Ai is the vertex of the obtuse angle, i.e. a+b≤50), these three vertices satisfy the conditions of the problem if and only if
(xi−xi−a)(xi−xi+b)=1,1◯
otherwise equals 0, here the subscript is modulo 101. Thus
N=i=1∑101(a,b)∑(xi−xi−a)(xi−xi+b),
here ∑(a,b) stands for the summation of all positive integer pairs (a,b) satisfying a+b≤50, there are 49+48+⋯+1=1225 such positive integer pairs. Expand 1◯, we have
N=i=1∑101(a,b)∑(xi−xi−a)(xi−xi+b)=i=1∑101(a,b)∑(xi2−xixi−a−xixi+b+xi−axi+b)=1225i=1∑101xi2+i=1∑101k=1∑50(k−1−2(50−k))xixi+k
=1225n+i=1∑101k=1∑50(3k−101)xixi+k,2◯
here n is the number of the blue vertices. For any two vertices Ai,Aj,
1≤i≤j≤101, let
d(Ai,Aj)=d(Aj,Ai)=min{j−i,101−j+i}.
Let B⊆{A1,A2,…,A101} be the set of all blue vertices, then 2◯ can be written as
N=1225n−101Cn2+3{P,Q}⊆B∑d(P,Q),3◯
where {P,Q} runs through all the two-element subsets of B. Without loss of generality, we assume n is even. Otherwise, color all the vertices the opposite, the value of N does not change. Write n=2t, 0≤t≤50, from one point, renumber all the blue vertices as P1,P2,…,P2t clockwise. Then
{P,Q}⊆B∑d(P,Q)=i=1∑td(Pi,Pi+t)+21i=1∑tj=1∑t−1(d(Pi,Pi+j)+d(Pi+j,Pi+t)+d(Pi+t,Pi−j)+d(Pi−j,Pi))≤50t+2101t(t−1),4◯
here the subscript of Pi is modulo 2t, and we use the inequality d(Pi,Pi+t)≤50 and
d(Pi,Pi+j)+d(Pi+j,Pi+t)+d(Pi+t,Pi−j)+d(Pi−j,Pi)≤101.5◯
Combine 3◯ and 4◯, we have
N≤1225n−101Cn2+3(50t+2101t(t−1))=−2101t2+25099t.6◯
The right hand side of 6◯ attains its maximum value when t=25, thus N≤32175.
The number of ways to choose 50 blue vertices such that N achieves maximum is equal to the number of ways to choose 25 diagonals from the longest 101 diagonals such that any two diagonals do not have common vertices.
Edging Ai and Ai+50, i=1,2,…,101, we get a graph G. Notice that 50 and 101 are relatively prime, so 1+50n (0≤n≤100) form a complete residue system modulo 101, i.e. G is a circle with 101 edges. Therefore, the number of ways (written as S) to color 50 vertices blue and N achieves maximum, is equal to the number of ways to choose 25 edges of G, such that any two of them do not have common vertices. Now, fix one edge e of G. Since the number of ways to choose edges having e is C7524, not having e is C7625, so S=C7524+C7625. Similarly, the number of ways to have 50 red vertices is also S, thus the number of ways to color the vertices such that the largest value of N is achieved is 2S.
In a word, the largest possible value of N is 32175, the number of ways to color is 2S=2(C7524+C7625).