Characterize Numbers that can be written as the Sum Of Three Consecutive Positive Integers

I am looking to characterize the numbers that can be characterized as the sum of 3 consecutive integers, but that can only be written in one way so for example $12 = 3 + 4 + 5$ but not $15 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5.$

So in general I'm looking for numbers of the form $a + (a+1) + (a+2) = 3a+3.$

Where would I go from here? Would I show what even numbers & what odd numbers can be written?

• Please do not write things like 5=4+5+6 again. – DanielWainfleet Mar 20 '17 at 10:17

-----------This answer is incomplete now due to the recent clarification in the edit specifying looking only for those numbers which can be written as the sum of 3 consecutive integers but not by any amount larger -----------

Original answer for when interpretation of question was just about whether or not it could be written as sum of 3 integers with no other constraints

Instead of characterizing them by the smallest number, characterize them by the middle number

$(b-1)+b+(b+1)=k$

You see then that these are the numbers of the form $3b$ greater than $6$ (* if you require all of the integers in the sum to be positive since the smallest sum of three consecutive positive integers is $1+2+3=6$, otherwise any multiple of three positive or negative will work*)

For completeness, we can show an if and only if condition here. The argument above shows that if a number can be written as the sum of three consecutive numbers that it must be a multiple of three.

Supposing a number $k$ is a multiple of three, then there is a $b$ such that $k=3b$ in which case $k=(b-1)+b+(b+1)$ is a way of writing it as the sum of three consecutive integers.

Attempt at a fix: The sum of $2a+1$ consecutive numbers with middle term $b$ will be $(2a+1)b$. If this is equal to our target number $k$ then that implies that $(2a+1)\mid k$.

Given that we want our number to be representable by the sum of three numbers that implies that $3\mid k$. Given that we do not want our number to be representable by the sum of any other number of odd integers implies that $(2a+1)\not\mid k$ for all $a\geq 2$. This in particular implies that no prime larger than $3$ and no power of three other than three itself divides $k$ implying then that our numbers must be $3$ times a power of two, i.e. of the form $2^n\cdot 3$ for some $n$.

Still left to complete: Characterize the numbers which can simultaneously be written as the sum of three consecutive numbers and an even number of consecutive numbers which cannot be written in any other way as the sum of an odd number of consecutive numbers

Characterizing the sum of an even number of consecutive based on the term just under the middle, let there be $2a$ numbers total and let $b$ be the term just under the average, we have $(b-a+1)+(b-a+2)+\dots+(b-1)+b+(b+1)+\dots+(b+a-1)+(b+a) = 2ab + a$

Supposing our number could be written as the sum of three consecutive integers and in no other way as the sum of an odd number of integers and as the sum of $2a$ numbers, that implies that $2ab+a=3\cdot 2^n$ implying that $a\mid 3\cdot 2^n$ and that $(2b+1)\mid 3\cdot 2^n$.

As $2b+1$ is odd that implies that $2b+1=3$ or $1$ as these are the only odd factors of $3\cdot 2^n$. This implies the middle number is either zero or the middle number is $1$. Indeed, $6=1+2+3$ can also be represented as $6=0+1+2+3$.

In fact, any number can be written as a sum of an even number of consecutive terms if you allow negatives can be made using $b=0$. Take $n$ for example:

$n=(1-n)+(2-n)+\dots+(-1)+0+1+\dots+(n-2)+(n-1)+n$

Assuming you are referring only to representing numbers as the sum of positive numbers, this shows that any number of the form $2^n3$ cannot be written as the sum of an even number of consecutive positive integers and thus any number is expressable only as the sum of three consecutive positive integers if and only if it is of the form $2^n3$.

• There is still the OP's criterion that $k$ not be the sum of more than 3 consecutive numbers. I think we can just continue your construction to show that $k$ has to be of the form $2^n 3.$ – B. Goddard Mar 20 '17 at 11:37
• @B.Goddard ah, that criterion was not made clear until the recent edit. Yes, then I believe you are correct that it will be numbers of the form $2^n3$. Certainly avoiding any way of writing using an odd number of integers except 3 causes this... but what about as a sum of an even number of integers? I haven't gotten this far yet in my thought process to see if there are some numbers of the form $2^n3$ which can be written as a sum of three integers and as the sum of an even number of integers. – JMoravitz Mar 20 '17 at 16:19