I have seen elsewhere that every positive integer greater than 1 that is not a power of 2 can be written as the sum of some number of consecutive positive integers; however, given a specific x and y, where x and y are positive integers, can one find a formula to determine if x can be written as the sum of y consecutive positive integers?
For example, 15 can be composed of 3 consecutive positive integers, 4 + 5 + 6, but 14 cannot. However, 14 can be composed of 4 consecutive positive integers, 2 + 3 + 4 + 5, while 15 cannot.
In looking through some examples, I observed that a given x can be expressed as the sum of y consecutive positive integers if x - (the sum of the first y - 1 positive integers) is evenly divisible by y. That latter term is the (y-1)th triangular number, so we can simplify to $y|(x - {y \choose 2})$, or $x - {y \choose 2} \pmod y \equiv 0$.
Working through those examples above once more, we have:
$x = 15, y = 3 \rightarrow 15 - {3 \choose 2}\pmod 3 = 15 - 3 \pmod 3 = 12 \pmod 3 \equiv 0$;
$x = 14, y = 4 \rightarrow 14 - {4 \choose 2}\pmod 4 = 14 - 6 \pmod 4 = 8 \pmod 4 \equiv 0$;
$x = 15, y = 4 \rightarrow 15 - {4 \choose 2}\pmod 4 = 15 - 6 \pmod 4 = 9 \pmod 4 \equiv 1$;
$x = 14, y = 3 \rightarrow 14 - {3 \choose 2}\pmod 3 = 14 - 3 \pmod 3 = 11 \pmod 3 \equiv 2$.
I have stated all of this, but provided no formal proof for any of it. So, finally getting to the question part of this question: can anyone think of a proof that, for positive integers x, y, x can be expressed as the sum of y consecutive positive integers iff $x - {y \choose 2} \pmod y \equiv 0$? In addition to that, is it possible to simplify that any further, perhaps due to some shared properties of binomial coefficients and modular arithmetic?
I wrote up a post about this on my website here with some more examples and my though process.
Your condition is not correct. As @peterwhy's comment proves, your condition is a necessary condition for $x$ being able to be written as a sum of $y$ consecutive positive integers, but it is not a sufficient condition. For example, take $x=14$ and $y=7$. Then, we have $$ 14-\binom{7}{2}=-7\equiv 0\pmod{7} $$ However, $14$ can not be written as $7$ consecutive positive integers, because, since the minimum possible starting positive integer is $1$, the minimum possible value for $7$ consecutive positive integers is $1+2+\cdots+7=28$ and $14 < 28$.
Ergo, we have another sufficient condition for $x$ being able to be written as $y$ consecutive integers: $x$ needs to be at least $1+2+\cdots+y$. Using the well-known formula for sums of arithmetic sequence, in other words, we need that: $$ x\geq \frac{y(y+1)}{2} $$
Now we have two necessary conditions, $y \mid (x-\binom{y}{2})$ and $x \geq [y(y+1)]/2$, for $x$ being able to be written as the sum of $y$ consecutive positive integers. My claim is that these two conditions are also sufficient, i.e. if these two conditions hold, then $x$ can be written as the sum of $y$ consecutive integers. Specifically, we can write $x$ as the following sum: $$ \frac{x-\binom{y}{2}}{y} + \left(\frac{x-\binom{y}{2}}{y}+1\right) + \cdots + \left(\frac{x-\binom{y}{2}}{y}+y-1\right) $$ First, we know that $(x-\binom{y}{2})/y$ is an integer because $y \mid (x-\binom{y}{2})$. Moreover, $(x-\binom{y}{2})/y$ is a positive integer because, by our second condition: $$ \begin{align*} & x \geq \frac{y(y+1)}{2} \\ \implies & x-\binom{y}{2} \geq \frac{y(y+1)}{2}-\frac{y(y-1)}{2}=\frac{2y}{2}=y \\ \implies & \frac{x-\binom{y}{2}}{y} \geq 1 \end{align*} $$ Ergo, since the first number in our sum is a positive integer and every next number in the sum is just $1$ plus the previous number, our sum is clearly the sum of $y$ consecutive positive integers.
Finally, it suffices to show that our sum is equal to $x$. Since every number in our sum has $(x-\binom{y}{2})/y$ as a term, we can essentially take the $y$ copies of that number out of the sum, and then we are left with: $$ \begin{align*} & y\left(\frac{x-\binom{y}{2}}{y}\right)+1+2+\cdots + (y-1) \\ = & \left(x-\binom{y}{2}\right)+\binom{y}{2} \\ = & \ x \end{align*} $$ as was to be shown. With this, we have finished showing that the two necessary conditions we found are also sufficient for $x$ being able to be written as the sum of $y$ consecutive integers.