With four colors, splitting the evens among colors can raise the share of three-color sums from 9/17 to 16/27
Why it matters
How often can two numbers and their sum all have different colors? With four colors on a long list of consecutive positive integers, the best you can do if every even number has the same color is about 53%. Group the numbers by their remainders after division by three and change colors at two points along the list, and about 59% of sums have three different colors.
Color each integer from 1 to n and write down every sum that stays in that range. How often can the two addends and their answer all have different colors? Call such a sum rainbow. The best known way to get rainbow sums with three colors gives every even number the same color. With a fourth color available, should one keep that rule and use the extra color on the odds, or split the evens among different colors?
Keeping all evens one color gives at best 9/17 (52.94%) rainbow sums as n grows, even with complete freedom to color the odds. Giving the multiples of three one color instead, and coloring the other numbers by their size and their remainder on division by three, gives 16/27 (59.26%).
We count each ordered pair (x,y) of positive integers with x+y\le n once. Thus 2+3=5 and 3+2=5 count separately, and 2+2=4 counts in the denominator but can never be rainbow. There are n(n-1)/2 pairs. Parczyk and Spiegel [1] obtained a limiting rainbow fraction of 2/5 with three colors. Hegde, Kumar and Pratibha [2] raised it to 9/22: they gave the evens one color and divided the odds, in increasing order, into three blocks with colors A, B, A and relative lengths 4:6:1. They asked whether any three-color rule can beat 9/22. For four colors their general construction gives a lower bound of 10/21 on the largest possible fraction.
The two four-color rules
Figure 1 shows how to gain 6.32 percentage points over the best rule that gives every even number the same color. In the upper coloring, the evens have color D and the odds form five successive blocks, A, B, C, B, A, with lengths in the ratio 4:3:6:3:1. In the lower coloring, the multiples of three have color D. Numbers with remainder 1 or 2 both take color A up to n/4. From there through 2n/3, those with remainder 1 take B and those with remainder 2 take C. Beyond 2n/3 the two groups exchange colors.

Figure 1. To color an integer, choose its row and read the letter at its position. The upper coloring attains the largest limiting rainbow fraction possible with one color on the evens. The lower coloring shows what is possible when the evens can have different colors.
To count the rainbow sums in the lower coloring, plot each pair of addends as a point (x/n,y/n) in the unit square. The eligible points lie on or below the diagonal x/n+y/n=1. Divide each axis into twelve equal bins numbered 0 through 11, so both changes of color fall at bin boundaries. If the addends lie in bins i,j, their sum lies in bin i+j or i+j+1. The line separating those cases cuts the small square for bins i,j into two triangles of equal area. Discard triangles with sum bin above 11. There are 144 triangles left, covering the eligible half of the unit square.
Within each triangle the bins of the addends and the sum are fixed. Their colors now depend only on the addends' remainders a,b: the sum has the remainder of a+b on division by three. All nine ordered pairs of remainders have the same limiting frequency within a triangle, since away from its edges each three-by-three square of lattice sites contains one of each. Table 1 counts the triangles that give a rainbow sum for each remainder pair.
| First addend's remainder | Second: 0 | Second: 1 | Second: 2 |
|---|---|---|---|
| 0 | 0 | 94 | 94 |
| 1 | 94 | 72 | 124 |
| 2 | 94 | 124 | 72 |
Table 1. Rainbow triangles out of 144 for each pair of remainders. For each of the two possible sum bins, count one if its color and the two addend colors in Figure 1 are distinct.
For example, remainders 1 and 2 sum to remainder 0, colored D. When both addends are in the first interval, both have color A. This square covers 18 triangles. They also match if one is in the middle interval and the other in the last. The condition x+y\le n leaves just one triangle in each order there, since 1-1/4-2/3=1/12. That leaves 144-18-2=124 rainbow triangles. Summing all entries gives 768/(9\cdot144)=16/27. This improves the four-color lower bound. To compare it with every monochromatic-even coloring, we need an upper bound that also covers irregular arrangements of the odds.
The exact ceiling with one color on the evens
With one color on the evens and r\ge2 additional colors, the maximum rainbow fraction tends, for fixed r as n grows, to
An exact search over finite intervals allowed each odd integer its own choice of color. Using four colors in total and fixing the color of the evens, we optimized over 124 interval sizes; on the largest, with 1,024 odds, an optimal coloring had block lengths 241, 181, 362, 180, 60. These are close to 4:3:6:3:1. For every r from 2 through 7 and every number of odds from 1 through 100, rounding each proposed boundary up or down gave at least one coloring matching the exact optimum. The following count explains why these proportions are optimal in the limit.
Counting pairs of odds
Every rainbow sum contains two distinct odd numbers. A sum with no odds has just the even color, and an odd number carrying the even color cannot belong to a rainbow sum. Recoloring any such odd number with one of the r other colors therefore preserves every existing rainbow sum. Now two odds u<v of different colors yield u+(v-u)=v and, if u+v\le n, also u+v with even answer. Each counts in both orders. Minimizing the lost opportunities from same-color odd pairs will therefore maximize the rainbow count.
Rescale the odd positions onto an interval of length D=6r-1, chosen to make the proposed block lengths integers. Use u,v for the rescaled positions. Each pair 0<u<v<D has weight one for the sum with odd answer, plus one for the sum with even answer if u+v<D. Let C be the area occupied by same-color pairs, counting each part of that area with its weight. The whole triangle, of area D^2/2 with an extra unit of weight on half its area, has weight 3D^2/4, so the rainbow fraction is
For two colors on the odd positions this weighted area also has a classical interpretation. Use those two colors on the whole continuous interval and count unlike pairs of entries in each sum. A pair u<v occurs as addend and answer in both orders of the addends, and as the two addends in both orders if u+v<D. Its multiplicity is twice our weight. Every sum that uses both colors contains exactly two unlike pairs. Thus the parity rainbow fraction is half the fraction of these two-color sums that use both colors. Robertson and Zeilberger [4] showed that the smallest limiting fraction of sums with all entries the same color is 2/11. This gives (1-2/11)/2=9/22. With three or more colors on the odds, a sum can have three unlike pairs; the same reduction no longer works.
Counting the same-color cost from the middle outward
To bound C for any arrangement of colors, grow an interval from the midpoint of the full interval, adding its left and right endpoints at unit speed for time 0<t<T=D/2. The new left endpoint forms a pair of weight two with every point already present: even the largest earlier point sums with the new left endpoint to less than D. The new right endpoint forms a pair of weight one with every earlier point. Call the left insertion heavy and the right insertion light. Let b_i(t) be the amount of color i already present, and F_i=b_i(T). At time t, write b_H for the amount already present of the color at the new left endpoint, and b_L for the corresponding amount on the right. Thus
The cost at the start and finish
The ordinary charge \tfrac12\sum_i F_i^2 depends only on the final sizes. The extra charge \int_0^T b_H\,dt depends on timing: adding a color on the heavy side costs less while that color is scarce. To bound this charge, use size 3 as a reference. For each heavy insertion, pay 3, take a discount if the current size is below 3, and pay a surcharge if it is above 3.
Write z_+=\max(z,0). Across both sides, the total discount available for color i is the integral of (3-s)_+ as its size s grows from zero to F_i. This is at most \int_0^3(3-s)\,ds=9/2. Starting from the base charge 3T, subtract that maximum for each color. Add back the discounts that went to light insertions, then add the heavy surcharges. Hence
The light side necessarily uses some of the discounts at the start. No color can grow faster than the two sides together, so b_L(t)\le 2t. The first integral of positive parts is at least \int_0^{3/2}(3-2t)\,dt=9/4. To bound the heavy surcharges near the finish, let f=\min_i F_i be the smallest final color size. With s=T-t time left, every color already has size at least f-2s. Integrating (f-3-2s)_+ over the remaining-time coordinate bounds the second integral below by (f-3)_+^2/4 (note f\le 2T).
Since \sum_i F_i=D, the ordinary charge is
The proposed block rule attains this bound. Read its blocks from the middle outward. Both sides meet the colors in order r,r-1,\ldots,1. The table gives the time each side spends adding each color.
| side | first color (r) | each intervening color | last color (1) |
|---|---|---|---|
| heavy (left) | 1.5 | 3 | 4 |
| light (right) | 4.5 | 3 | 1 |
Both sides start together for 1.5 units: the light side pays exactly the start penalty. The heavy side then fills the first three units of each remaining color in turn while the light side finishes the previous one. Only for the last unit of time do both add to the final color together, taking it from size 3 to 5. Thus the light side never again enters below size 3, the heavy side exceeds 3 only in that last unit, and all but one color finish at 6. Every bound above is tight. The resulting fraction tends to 3/4-15/(4D)=9(r-1)/(2D), as claimed.
Computational methods and checks
The finite parity search used the same distinction between pairs that count once and pairs that count twice. On an interval with m odd sites and n=2m, index the odds from 0 to m-1. Repeatedly remove the lowest remaining index if it sums with the highest to less than m; otherwise remove the highest. In reverse order each site then pairs with every earlier site at a common weight w, either two or one. Starting with empty color classes, record how many sites have each color. For every list of counts, keep the smallest same-color cost found so far. Adding a site to a class of size b costs wb. Keeping only the least cost loses no possible improvement, because future increments depend only on the counts.
For the four-color alternative, we searched rules assigning a color to each combination of interval bin and remainder. We tried divisors from 1 to 12 for taking remainders and divided the interval into 1, 6, 11 or 18 bins. With 12 starts per combination, this gave 576 initial runs. The best fraction was 431/729. Another 240 runs on finer grids reached 16/27 with three remainders and 36 bins, but only two changes of color along the interval. Allowing different cut positions in the two nonzero remainder classes gave no improvement in 12,652,440 tested choices of cuts and color orders. Table 1 verifies the resulting rule independently of how well the search explored other rules.
We also checked the counting conventions against Heule’s public list of constraints for sums on the first 160 integers [3]. The constraints encode 6,400 distinct sums with unordered addends. Counting both orders for unequal addends reproduced the odd-pair count for each of the six tested palettes on every interval from 1 to n with n from 3 through 160. For the rule based on remainders after division by three, the direct counts of rainbow sums at n=36,72,108,144 were 394, 1,556, 3,486 and 6,184. The limiting value comes from the equal-area count, which omits the finite boundary terms.
With three colors, beating 9/22 would require giving the evens more than one color. With four, the rule based on remainders gains 16/27-9/17=29/459 over the best rule with one color on the evens. The unrestricted four-color maximum remains open: this construction gives a lower bound, and the general upper bound of Hegde, Kumar and Pratibha [2, Theorem 1.3] gives 3/4.
References
- O. Parczyk and C. Spiegel. An unsure note on an un-Schur problem.
- S. Hegde, H. Kumar and Pratibha. A somewhat sure note on an un-Schur problem, Theorems 1.1 and 1.3 and Problem 1.2 (2026).
- M. J. H. Heule. Schur Number Five: constraints for five colors on the first 160 integers.
- A. Robertson and D. Zeilberger. A 2-coloring of [1,n] can have (n²)/22 + O(n) monochromatic Schur triples, but not less!, Electronic Journal of Combinatorics 5 (1998), R19.