Background (feel free to skip this part)
Suppose we want to $k$-partition all the positive integers up to (and including) some integer $N$. This partition should divide the numbers into $k$ sets, such that each set has the same sum.
For example, for $N=4$, there is one possible $2$-partition: $\{1,4\},\{2,3\}$ (since the sum of the numbers in each is $5$). For another example, with $N=7$ there are multiple possible 2-partitions, one of which is: $\{1,2,4,7\},\{3,5,6\}$ (since the sum of the numbers in each is $14$).
We can see that in order for any $N$ to have a valid $2$-partition, we need $\sum_{i=1}^N i = \frac{N(N+1)}{2}$ to be divisible by $2$, meaning $$N(N+1) \text{ divisible by 4} \Rightarrow N \text{ or } N+1 \text{ divisible by 4}$$
It isn’t too difficult to determine similar requirements on $N$ for the existence of other $k$-partitions: $$k=3: \quad N(N+1) \text{ divisible by 6} \Rightarrow N \text{ or } N+1 \text{ divisible by 3}$$ $$k=4: \quad N(N+1) \text{ divisible by 8} \Rightarrow N \text{ or } N+1 \text{ divisible by 8}$$ $$\vdots$$
It might be interesting to investigate how many $k$-partitions there are for any given $N$, but I’m more interested in the problem of imposing restrictions on the partitions (which makes it more difficult to find the $N$ for which they exist).
The problem
Let’s say we want (what I have dubbed) a consecutive $k$-partition. That is, divide the positive integers up to (and including) $N$ into $k$ sets, such that each set has the same sum and the sets are ordered, with the largest number in each set being 1 less than the smallest number in the next set. (Clearly, if there exists a consecutive $k$-partition for $N$, there is only one such partition.)
In the case $k=2$, a consecutive $2$-partition exists for $N$ if we can find an $a$ such that: $$1+2+\ldots+a = (a+1)+(a+2)+\ldots+N$$
For example, for $N=3$ there is one possible consecutive $2$-partition: $\{1,2\},\{3\}$. The next $N$ for which there exists a consecutive $2$-partition is $N=20$, where $a=14$ and we have: $$1+2+\ldots+14=105=15+16+\ldots+20$$
In general, a consecutive $2$-partition exists for $N$ if we can find an $a$ such that $$\frac{a(a+1)}{2} = \frac{N(N+1)}{2} - \frac{a(a+1)}{2},$$ which by the quadratic formula means we need $$a = \frac{\sqrt{2N^2 + 2N + 1}-1}{2}$$ to be a positive integer. Since the root term will always be odd, the top will always be divisible by $2$, so we just need $$a = 2N^2 + 2N + 1$$ to be a square number.
Interesting note: We want $a = Z^2$ for some positive integer $Z$, and we can write $a = 2N^2 + 2N + 1 = N^2 + (N+1)^2 = Z^2$, and the rightmost equation is precisely the set of Pythagorean triples $(X, X+1, Z)$.
Using this formula, the next $N$ after $3$ then $20$ seems to be $119$, then $696$, then $4059$, then $23660$. Clearly these grow farther apart, and a brute-force iteration over all the positive integers will be very slow in finding these. Is there a formula to find $N$s for which this $a$ exists? Or, as a more theoretical question: What can we know about the set of these $N$s (how are they distributed among the positive integers)?
This gets more tricky with consecutive $3$-partitions. For any $N$, we need to find a $b$ and $c$ such that $$\frac{b(b+1)}{2} = \frac{c(c+1)}{2} - \frac{b(b+1)}{2} = \frac{N(N+1)}{2} - \frac{c(c+1)}{2},$$ which means we need both of the following to be positive integers: $$b = \frac{\sqrt{12b^2 + 12b + 9} – 3}{6}$$ $$c = \frac{\sqrt{24b^2 + 24b + 9} - 3}{6}$$ Multiplying the top and bottom by $\frac{1}{3}$ and noting that the top will then always be divisible by $2$, we just need $$b = \frac{4}{3}N^2 + \frac{4}{3}N + 1$$ $$c = \frac{8}{3}N^2 + \frac{8}{3}N + 1$$ to be square numbers.
I tested the above formulas on the first $25000$ positive integers, and haven’t found any $N$s with a consecutive $3$-partition. Are there any?
Summary of the questions
- Is there a formula to find $N$s for which a consecutive $2$-partition exists (without needing to iterate and see if there exists an integer $a$)?
- Are there any $N$s for which a consecutive $3$-partition exists? What about for consecutive $4$-partitions, or $5$, etc.?
- For any $k$, what do we know (about the distribution among the positive integers) of the set of $N$s for which a consecutive $k$-partition exists?
I’m fascinated by this topic, and any insights you can provide (perhaps using knowledge gleaned from more advanced number theory) would be helpful!
UPDATE on question 2
For consecutive $3$-partitions, it seems like $N$s that satisfy the conditions on $b$ and $c$ can be expressed by recursive formulas: $$\text{condition on } b \Rightarrow N_{i+2} = 4N_{i+1} - N_i + 1 \text{, with } N_0=0 \text{ and } N_1 = 2$$ $$\text{condition on } c \Rightarrow N'_{i+2} = 10N'_{i+1} - N'_i + 4 \text{, with } N'_0=0 \text{ and } N'_1 = 5$$ Side question: Is there a way to prove this?
By iterating $i$, we can generate $N$s which satisfy the first condition, and $N'$s which satisfy the second condition. I have done this to generate $N$ and $N'$ all the way up to $10^{300}$, and there are none which satisfy both conditions! Does this make it very likely that no consecutive $3$-partitions exist?
These recursive formulas can also be expressed in closed form: $$N_i = \frac{1}{4} \left((1+\sqrt{3})(2+\sqrt{3})^i + (1-\sqrt{3})(2-\sqrt{3})^i - 2 \right)$$ $$N'_i = \frac{1}{4} \left((1+\frac{\sqrt{6}}{2})(5+2\sqrt{6})^i + (1-\frac{\sqrt{6}}{2})(5-2\sqrt{6})^i - 2 \right)$$ So the question becomes: $$\{N_i \mid i \in \mathbb{Z^+}\} \cap \{N'_i \mid i \in \mathbb{Z^+}\} = \emptyset?$$