6

I came across this problem the other day. It is as follows:

The strange sum is as follows. Starting at the any term in a set, when the next term is added to the 'tally', the second term is subtracted from the first if the result is nonnegative, otherwise it is added to the tally. Then the third term is subtracted from the strange sum if the result is nonnegative, otherwise it is added to the 'strange sum'. Repeat the process. For example, the 'strange sum' of the sequence $1, 3, 4, 2, 5$ is $1+3-4+2+5=7$

Suppose there is a list of numbers from $1$ to $100$ in some order. What is the largest possible 'strange sum'?

I couldn't find any clear pattern. However, I did notice that if the sum of the first $99$ terms is $99$, then $100$ can be added, hence making the total sum $199$. Any thoughts on this problem?

(edit) I just realised that $199$ is impossible as the sum of the first $99$ natural numbers is even and so it would be impossible to achieve a 'strange sum' of $99$. That would mean that $198$ is the next highest possibility. $98$ is achievable via the 'strange sum' by the first $99$ natural numbers in some order, though I still have not been able to constitute a proof for $198$.

  • 2
    I made a quick simulation, computing the maximum strange sum of all permutations of $1 \ldots, n$. The results for $n$ up to $12$ are: $1, 3, 4, 6, 9, 11, 12, 14, 17, 19, 20, 22$, which could be http://oeis.org/A047415: “Numbers that are congruent to {1, 3, 4, 6} mod 8.” – Martin R Sep 09 '20 at 07:32
  • @MartinR I did the same but you beat me to the punch. Nice job! I'll be excited to find why this is related if they are in fact the same. Just to add, if this is true, then the maximum strange sum for set of the first 100 numbers would be 198. – Kirk Fox Sep 09 '20 at 07:34
  • Where does the problem come from? – Martin R Sep 09 '20 at 07:37
  • @Martin R It's from an Olympiad paper – Maths explorer Sep 09 '20 at 07:42
  • Can you please add the exact source? – Martin R Sep 09 '20 at 07:45

1 Answers1

4

Well you can't reach $199$, but you can reach $198$. I'll prove both:

In order to reach $199$, we need to reach $0$ with the first $98$ numbers.

But $\dfrac {98(98+1)}2=49\times 99$ is odd, so you can't split the list $\{1,\dots,98\}$ into 2 parts with equal sum.

[EDIT2: An easier way to see this is to notice the parity of the odd sum and $1+2+\dots+100$ must be the same; changing signs do not change the parity.]

Here is a way to reach $198$: $(1,96,2,95,\dots,48,49,97,99,98,100)$

The first $96$ numbers cancel out. $97+99-98+100=198$.

EDIT: To see the relation to A047415, we consider this:

If the sum of the first $(n-2)$ numbers is even, we can split the first $(n-2)$ numbers into two parts of equal sum. Manipulating the order of our sum will give $0$, so we can reach $(n - 1) + 1 = 2n-1$.

If the sum of the first $(n-2)$ numbers is odd, the sum of the first $(n-4)$ numbers is even. We can split the first $(n-4)$ numbers into two parts of equal sum. Manipulating the order of our sum will give $0$, so we can reach $(n-3)+(n-1)-(n-2)+n=2n-2$.

For $n = 4k+r$, the sum of the first $(n-2)$ numbers is $\dfrac {(n-2)(n-1)}2 = \dfrac {(4k+r-2)(4k+r-1)}2$, which is even for $r=1,2$, odd for $r=0,3$.

Hence: $$4k\mapsto 8k-2$$$$4k+1\mapsto 8k+1$$$$4k+2\mapsto 8k+3$$$$4k+3\mapsto 8k+4$$

which is $1,3,4,6 \pmod 8$, in that order.

player3236
  • 16,413
  • That sequence looks good to me. – Maths explorer Sep 09 '20 at 07:48
  • I neglected to show why the sum cannot exceed $2n-1$, but I hope that is clear. – player3236 Sep 09 '20 at 07:53
  • Just out of curiosity, you say: "In order to reach 199, we need to reach 0 with the first 98 numbers". How can we be sure that this is no other possible permutation that reaches 199 (e.g including numbers $ < 98$)? – HelloWorld Sep 09 '20 at 08:01
  • 1
    In hindsight, there could be others, e.g. the "sum" is $2$ and add $97$ and $100$. That's why I (should) have replaced it with a parity argument. – player3236 Sep 09 '20 at 08:04
  • @Dimitris Indeed - if you could get to $2$ and then add $97$ and $100$ - or $1$ and add $98$ and $100$ - but I think there will be a parity problem. – Mark Bennet Sep 09 '20 at 08:05