A [sequence or a series](http://world.mathigon.org/Sequences), in mathematics, is a string of objects, like numbers, that follow a particular pattern. The individual elements in a sequence are called terms. A simple example is `3, 6, 9, 12, 15, 18, 21, ...`, where the pattern is: _"add 3 to the previous term"_.

In this kata, we will be using a more complicated sequence:   `0, 1, 3, 6, 10, 15, 21, 28, ...`
This sequence is generated with the pattern: _"the nth term is the sum of numbers from 0 to n, inclusive"_.

```
[ 0,  1,    3,      6,   ...]
  0  0+1  0+1+2  0+1+2+3
```

## Your Task

Complete the function that takes an integer `n` and returns a list/array of length `abs(n) + 1` of the arithmetic series explained above. When`n < 0` return the sequence with negative terms.

## Examples 

```
 5  -->  [0,  1,  3,  6,  10,  15]
-5  -->  [0, -1, -3, -6, -10, -15]
 7  -->  [0,  1,  3,  6,  10,  15,  21,  28]
```

Difficulty: introductory

Starter code:

def sum_of_n(n):
	

Solutions:
def sum_of_n(n):
    return [(-1 if n < 0 else 1) * sum(range(i+1)) for i in range(abs(n)+1)]


def sum_of_n(n):
    output = [0]
    sign = 1
    if n < 0: sign = -1
    for numb in range(1, abs(n) + 1):
        output.append(sign * (numb + abs(output[numb - 1])))
    return output

def sum_of_n(n):
    sign, n = (1, -1)[n < 0], abs(n) 
    return [sign * (i * i + i) / 2 for i in range (n + 1)]

def range_(n):
    if n > 0:
        return range(n+1)
    else:
        return [-i for i in range(-n+1)]

def sum_of_n(n):
    return [sum(range_(i)) for i in range_(n)]

from itertools import accumulate

def sum_of_n(n):
    return list(accumulate(list(range(0, *((n+1, 1) if n > 0 else (n-1, -1))))))


from itertools import accumulate

def sum_of_n(n):
    if n >= 0:
        return list(accumulate(range(n+1)))
    return list(accumulate(range(0, n-1, -1)))

import itertools

def sum_of_n(n):
    step = +1 if n >= 0 else -1
    return list(itertools.accumulate(range(0, n + step, step)))

def sum_of_n(n):
    if n<0:
        minus = True
    else:
        minus = False
    return [-sum(range(k+1)) if minus else sum(range(k+1)) for k in range(abs(n)+1)]


sum_of_n = lambda n: [0]+[sum(range(i+1))*(n/abs(n)) for i in range(1,abs(n)+1)]