The question is very ill formatted in every aspect and the answer could be anything you want.

Among common answers people give to this question, maybe the simplest one is **90**, and at least 2 ways to achieve that:

`n * (n + 1) = S`

```
2 * (2 + 1) = 6
3 * (3 + 1) = 12
...
6 * (6 + 1) = 42
9 * (9 + 1) = 90
```

Or with algorithms, which is simpler to think about than to write...

```
n = 2; S = 6;
loop:
print;
n = S + (6 + (n - 3) * 2);
```

which, in each line, will bring `n`

and `S`

values of (formula in middle):

```
n formula S comment
2 6 (starting condition)
3 = 6 + (6 + (3 - 3) * 2) = 12 ( 6 + 6)
4 = 12 + (6 + (4 - 3) * 2) = 20 (12 + 8)
5 = 20 + (6 + (5 - 3) * 2) = 30 (20 + 10)
6 = 30 + (6 + (6 - 3) * 2) = 42 (30 + 12)
... (42 + 14, 56 + 16)
9 = 72 + (6 + (9 - 3) * 2) = 90 (72 + 18)
```

To get to 9, we ignore 7 and 8 results, but not the maths / algorithm behind it.

There are two other common answers: 56 and 72. You just **ignore the left column skipping from 6 to 9**. It's probably easier to understand seeing the numbers:

`solution 56 - completely ignore left column`

```
1: 2 * (2 + 1) = 6
2: 3 * (3 + 1) = 12
...
5: 6 * (6 + 1) = 42
6: 7 * (7 + 1) = 56
```

And then:

`solution 72 - ignore left column only inside (n + 1)`

```
1: 2 * (2 + 1) = 6
2: 3 * (3 + 1) = 12
...
5: 6 * (6 + 1) = 42
6: 9 * (7 + 1) = 72
```