So what I mean is $a=n+(n+2)+(n+4)+\cdots+(n+2m)$, like 27=7+9+11, $5\ne1+3,2+4,1+3+5$ so it can't, since those are all the possibilities.
To simplify, $a=(m+1)n+2\sum_{i=1}^mi=(m+1)(m+n)$, and since $m$ and $n$ are both positive, $a$ cannot be a prime, but can it be every composite number? YES. Find the smallest prime factor, subtract one, that is $m$, now compute $\frac a{m+1}-m$, that is $n$.
$n$ calculated this way will never not be a positive integer.$a=(m+1)(m+c),c\ge1$ since $(m+1)\ge(m+c)$, since $(m+1)$ is the smallest prime factor of $a$, meaning no smaller numbers can divide it except $1$, but $a$ is composite so $(m+c)\ne1$. So $n=\frac{(m+1)(m+c)}{m+1}-m=m+c-m=c\ge1$
So in practice, for $3155$, the smallest factor is $5$, so $m=4$, giving $n=\frac{3155}{4+1}-4=627$, meaning $627+629+631+633+635=3155$ which checks out.
So, is my proof correct?
Yes, that looks correct in every way. I'd state your result as:
As you say, the proof is that the sum of $k$ consecutive odd or even integers starting at $m$ is: $$S \equiv \sum_{i=0}^{k-1} (m + 2i) = m +(m+2) + (m+4) + \ldots + (m+2[k-1])$$ which is: $$S\equiv km + 2\sum_{i=0}^{k-1}i = km + k(k-1) = k(m+k-1)$$
Now, if $k=1$ (if there is only one number in the sequence), then $S=m$. Otherwise, $k>1$, and $S = k(m+k-1)$, and both $k$ and $m+k-1$ are integers larger than 1, so $S$ is necessarily composite. It follows that a prime number $p$ can just be represented as the trivial (i.e. length 1) sequence containing only $p$; every longer sequence has a composite sum.
It remains to show that every composite number can be written as a nontrivial sequence. But indeed, if a composite number factors as $q\equiv a\cdot b$, assume without loss of generality that $1<a\leq b$ and put $k\equiv a$, $m\equiv b - a + 1$.
Then the sequence consists of $k>1$ consecutive odd/even integers whose sum is $S = k(m+k-1) = a(b-a + 1 + a - 1) = ab = q$.
Addendum: Interestingly, we can get the following corollary: when $q=a^2$ so $a=b$, our process yields $k=a$ and $m = b- a + 1 = 1$. Hence we derive the result that every perfect square $n^2$ can be written as the sum of the first $n$ odd numbers.