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

elementary-number-theorysolution-verification

Find the number of ways in which $2022$ can be written as a sum of consecutive integers.

My attempt:
According to the question, $$2022=\sum_{i=0}^n (x+i)$$ which means $$2022=\sum_{i=1}^n {(i)} + x \times{(n+1)}$$ which means $$\frac{4044}{n+1}=2x + n$$ By simply rearranging using that $$\sum_{i=1}^n {(i)}=\frac{(n^{2}+n)}{2}$$ which means $${(n+1)}\mid{4044}$$ and $$4044=2^{2}\times3\times337$$ and it can $12$ divisors which means n takes 12 value but got violated at $divisor=1$ which makes $n=0$ HENCE $11$ WAYS

But the answer is given $4$; where I am wrong?

Any help will be greatly appreciated.

Best Answer

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.