# Series: $a+b+a+b...+a+b, b>=a$

Consider the series $a+b+a+b+...+a+b+a+b, b >=a$

A general expression for the nth sum of this series is given by:

$n (\frac{a+b}{2}) - (\frac{b-a}{2}(n(mod 2))$)

When $a=b$ this generalizes to $a \times n$

Can anyone point me to more information about this series? It may be interesting to find an expression for the $nth$ term of $a+b+c+....+a+b+c, a<=b<=c$ and so on for more terms $(a,b,c,...,x,y,z)$ etc.

I came up with this expression myself and realize I might be over complicating something simple. Any information is appreciated, especially with respect to notation. Note by Steven Kidd
6 years ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

a,b,c... etc are positive integers

- 6 years ago

With notation I personally dont really like your use of mods although I understand what you mean. I would write: $U_{n} = n(a+b)/2 + (a-b)/4 + ((a-b)/4)(-1)^{n}$. Now for the generalisation: There are many better mathematicians on this site than me but I will give you my solution, leaving the proof to you (unless you ask me to explain): So, let k be the number of distinct terms (ie. a+b+c+a+b+c.... would be k= 3), n be the number of terms and we also have i where $i \equiv n \pmod{k}$, and also $i \ne {0}$. In this case we will call the distinct numbers $a_{1}$, $a_{2}$, $a_{3}$ etc. instead of a, b, c My formula would be:( $a_{1} \times (2n-i)$ + $a_{2} \times (2n-i)$ + $a_{3} \times (2n-i)$ + ... + $a_{i-1} \times (2n-i)$ + $a_{i} \times (2n-i)$ + $a_{i+1} \times (n-i)$ + $a_{i+2} \times (n-i)$ + $a_{i+3} \times (n-i)$ + ... + $a_{k} \times (n-i)$ ) / k. If $i = 0$ then it is trivial.

- 6 years ago

I've been looking back over this and realised I made a few errors. First of all, in the case where $k = 2$ it should be $-1^{n+1}$ instead of $-1^{n}$. As for the generalisation, I made a fairly stupid misrake, it should be: ( $a_{1} \times (n+k-i)$ + $a_{2} \times (n+k-i)$ + ... + $a_{i} \times (n+k-i)$ + $a_{i+1} \times (n-i)$ + $a_{i+2} \times (n-i)$ + ... + $a_{k} \times (n-i)$ )/ k

- 6 years ago

I like how you got rid of the mod, and it makes me wonder weather the same sort of thing could be done to get rid of a $- (n(mod k))$ term as i had used it in a general sense, (n,k positive integers, n <= k). I'll post back once I get some real time to go over this if I have any further questions, thanks :)

- 6 years ago

I have no idea how to do it efficiently, but I came up with this off the top of my head:

$n\text{ (mod }k)=\dfrac{k\cdot \text{arg}\left(e^{2\pi i n/k}\right)}{2\pi}$

Feel free to simplify it if you can find a way.

- 5 years, 6 months ago