Find Ways 2022 can be written as a sum of consecutive integers: Where am going wrong?

If a sequence of consecutive integers sums to a given number, and if the number of members of that sequence is odd, the average of the first and last members will be a whole number which is equal to the median number of the sequence. If the number of members is even, then the average of the first and last numbers will be a half integer disposed between the two central numbers in the sequence. Moreover, if the number of members of the sequence is odd, then the number of members must be a factor of the sum. If the number of members of the sequence is even, then the number of members is twice a factor of the sum. Finally, if the sum is to include only positive integers (NB the question stipulates integers, without limitation), the number of members of the sequence must be smaller than the square root of the sum.

$2022=2\cdot3\cdot337$. $2022$ has $8$ factors: $1,2,3,6,337,674,1011,2022$

The factor $1$ (formally, at least) gives rise to a sequence with one member: $2022$

The factor $2$ gives direct rise to no sequences, because $\frac{2022}{2}=1011$ and there can be no sequence with an even number of members centered on a whole number. However, $2$ gives indirect rise to a sequence because $\frac{2022}{2\cdot 2}=505.5$ which is a half integer, so we can construct a sequence of four members surrounding $505.5$, viz: $504,505,506,507$

The factor $3$ gives direct rise to a sequence with $3$ members centered on $\frac{2022}{3}=674$, viz: $673,674,675$.

The factor $6$ gives direct rise to no sequence because $\frac{2022}{6}=337$, a whole number which cannot be the center of an even number of members. But it gives indirect rise to a sequence of $12$ members because $\frac{2022}{12}=168.5$, viz: $163,164,165,166,167,168,169,170,171,172,173,174$

The four sequences described to this point (except the single member sequence $2022$) have all been identified by previous responders. Next, we examine instances in which the number of members of the sequence is greater than the square root of the sum.

The factor $337$ gives direct rise to a sequence because $\frac{2022}{337}=6$, so there is a sequence of integers with $337$ members centered on $6$ that sums to $2022$. However, many of the members of that sequence would be negative integers or zero. I will omit a full listing of that sequence here, but it begins at $-162$ and runs to $174$. Every positive integer smaller than $163$ is cancelled with a corresponding negative integer, leaving only $163,\dots,174$ already identified above.

Also, there will be a sequence of $1348$ members centered on $1.5$ and a sequence of $4044$ members centered on $0.5$. That final sequence is $-2021,-2020,-2012,\dots,-1,0,1,2,\dots,2021,2022$. Here, every positive integer except $2022$ is matched with a corresponding negative integer, cancelling each other out and leaving the sum as $2022$

Since the answer that OP stated as correct was $4$, I presume that the question intended to limit the sequences to positive integers.


hint

If $ x=0$, there is no solution.

If, $ x\ge 1$.

In this case, we have $$(2x+n)(n+1)=4044=2^2.3.337$$

with the condition $$2x+n>n+1$$

So, the possibilities are $$n+1=1,2, 3, 4, 12$$

but $ n=0, 1$ do not work.

If $ x\le -1$, then the possibilities will be $$2x+n=1,2,3,4,12$$


COMMENT.-Let $n$ be the starting integer. We have $$n+(n+1)+\cdots+(n+k)=(k+1)n+\frac{k(k+1)}{2}=2022\\k^2+(2n+1)k+2n=4044$$ According with Wolfram this equation has $16$ integer solutions but if we want to find just natural integers there are only the three solutions $$(n,k)=(0,2022),(3,504,(11,163)$$ Consequently we have just two solutions: $$504+505+506+507=2022\\163+164+\cdots+174=2022$$

The other integer solutions of the quadratic equation are $$(n,k)=(-5,-503),(-4,-672),(1010,-503),.....$$ but for rational integers giving place to the equation is not valid the expression $\dfrac{k(k+1)}{2}$ we have used.


Edit 3: The mistake I was making is that by the nomenclature chosen, n+1 is the number of terms of the series!

$\text{2}^{\text{nd}}$ try: $$2022=\sum_{i=1}^n {(i)} + x \times{(n+1)}$$ $$= \frac {(n+1)n}{2} + (n+1)x$$ $$\implies 4044= (n+1) (2x + n)$$ $$\implies 4044 \mid (n+1)$$ $$\implies 4044 \mid (2x + n)$$ So, $n+1$ could be $1 \text{ , } 2 \text{ , }3 \text{ , }4 \text{ , }6 \text{ , or }12$.
$n+1$ must be $3$,$4$,$5$,$6$, etc. because lower numbers can't sum to an even number.

So, we'll test $n+1$ being $3$, $4 \text{ , }6 \text{ , or }12$.

If $n+1=3$, $x=(1348-2)/2=673$, giving series $673$+$674$+675$, which works!

If $n+1=4$, $x=(1011-3)/2 = 504$, giving a series of $504$+$505$+$506$+$507$ which also works!

If $n+1=6$, $x=(674-5)/2$, which makes x a non-whole number. Anyway, the series $334.5$+$335.5$+$336.5$+$337.5$+$338.5$+$339.5$ sums to $2022$;

If $n+1=12$, $x=(337-11)/2=163$, so the series is $$2022=\sum_{i=0}^11 (163+i) = 2022$$, so it works! That's 4, although I wasn't expecting that one of the series wouldn't be whole numbers. Cool problem!

Original answer (incorrect) below:

$$2022=\sum_{i=1}^n {(i)} + x \times{(n+1)}$$ $$= \frac {(n+1)n}{2} + (n+1)x$$ $$= (n+1) (x + \frac {n}{2})$$ so, $${2022}\mid{n+1}$$ and $${2022}\mid{x+ \frac n 2}$$ The factorization of 2022 is: $$ 2 \cdot 3 \cdot 337$$ The divisors are: $$1 \text{ , } 2 \text{ , }3 \text{ , }6 \text{ , }337 \text{ , }674 \text{ , }1011 \text{ , }2022 \text{ (8 divisors)}$$ Focusing on $n+1$, we can disregard all the divisors above $6$, because $336$ terms (or more) added together would definitely exceed $2022$. So, $n+1$ might equal $ 1 \text{ , } 2 \text{ , }3 \text{ , or }6$. Testing those cases:

$n+1=1$: $n$ would be zero, so there would be no sequence. Throw out. $n+1=2$: $n$ would be one, so it's just the number $2022$, not really a sequence. $n+1=3$: $$2022 = (n+1) (x + \frac {n}{2})$$ $$\implies \frac {2022}{3}=x+1$$ $$\implies x = 674-1=673$$ so, $673+674=$ some odd number, which doesn't work. It occurs to me now that $n \mid 4$ because it must be even but the series must also add up to an even number. That means none of those divisors would work...