Hi!
First of all, you said that the sequence of the numbers in the sum 1+2+4+5+6+8+9+7+6+5+3+2+0 differed by alternating 1's and 2's. However, it differs by 1, 2, 1, 1, 2, 1, (-)2, (-)1, (-)1, (-)2, (-)1, (-)2; you have adjacent 1's in two places (4+5+6 and 7+6+5). If I understand you correctly, I think you are looking for the series:
1+2+4+5+7+8+8+7+5+4+2+1=54
(
1,
2, 3,
4,
5, 6,
7,
8, 9,
8,
7, 6,
5,
4, 3,
2,
1)
This is easier to compute than your previous randomized 58. My solution to this problem would be to divide it up into cases with a maximum number n (in this case, 9 would be the maximum number rather than 8). This number n would have to fall in one of the following cases.
Case I.
Case II.
Case III.
I divide it up into these 3 cases because they each have different results, as shown below. The reason I knew they would, though, is because the increments of 1 and 2 repeat every 3 (=1+2) numbers n. I will now use p rather than n to simplify the calculations.
Case I.
As in the example with n=9, the numbers are symmetric about n, so you could rewrite this as:
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
Although there are quicker ways of solving this, I thought that this would be a good start to showing you how to do it. As you can see, it simplifies nicely. I numbered the lines of work in case you have any questions.
Now you can solve the other two cases!