Question: I'm a total JS noobie, and I'm trying to make it so that after one input is entered all of the numbers between 0 and that input are added up, including the input. Here is the basic pseudo code I'm trying to accomplish but i can't figure it out?

```
get count from user

loop up to count{

     add current number to sum

}

display sum

display breakline

loop up to count with a different loop type{

    add current number to sum

}

display sum

```

Answer: 
The fastest way to do this is by adding a sequence (looping not required):

```
let sum = input * (input + 1) / 2

```

[See this link for more information.](http://www.themathworld.com/math-tricks/adding-sequence-of-numbers.php)
```
var sum = 0;
var input = getCountFromUser(); //However you do it.
for (var j = 1; j <= input; j++) {
  sum += j;
}

```

Or, somewhat shorter:

```
var sum = 0, input = getCountFromUser(), j = 1;
for (; j <= input;) {
  sum += j++;
}

```