On a circle are placed nonnegative real numbers
$$\nwith indices taken modulo $n$ (so $x_{n+1}=x_1$, $x_{n+2}=x_2$, etc.).\nThey satisfy the local constraint $$\nx_i + x_{i+1} + x_{i+2} \le 1 \qquad\text{for all } i=1,2,\dots,n.\nFor such a configuration define
$$\nLet $M_n$ be the maximal possible value of $S$ over all admissible configurations $(x_1,\dots,x_n)$ satisfying the above condition. \nIt can be shown that for each positive integer $n$, the maximum $M_n$ is a rational number.\nFor the specific case $n=2026$, write $$\nM_{2026} \;=\; \frac{p}{q} $$\nin lowest terms, where $p$ and $q$ are coprime positive integers. \nDetermine the integer $p+q$.The maximum value for is achieved with a periodic pattern where if is odd and if is even, which satisfies the local constraint for all . This configuration gives:
for even . Substituting :
The fraction is in lowest terms since 1013 and 4 are coprime (1013 is odd and not divisible by 2). Thus, and , and:
[THOUGHT] We are to compute M_{2026} for the given problem. The maximum S is achieved with a periodic pattern and equals 2026/8. We will use Python to compute the reduced fraction and then output p+q. [/THOUGHT] [PYTHON] from math import gcd
n = 2026 numerator = n denominator = 8
g = gcd(numerator, denominator) p = numerator // g q = denominator // g print(p + q) [/PYTHON]