I want a rule (or at least a way to find a rule) for
2 input = 2,
4 input = 2+4,
6 input = 2+4+6
8 input = 2+4+6+8
10 input = 2+4+6+8+10
The input/output would be:
x=2 | y=2 |
x=4 | y=6 |
x=6 | y=12 |
x=8 | y=20 |
x=10 | y=30 |
x=12 | y=42 |
x=14 | y=56 |
x=16 | y=72 |
The series 2 + 4 + 6 + 8 (etc) is an arithmetic series and you want its sum.
The formula for an arithmetic series is: Sum = N(F + L)/2
where N = number of terms F = first term L = last term
Each sum starts with 2, so F = 2.
The value for N is x.
Also, the last term is x, so L = x
The sum then is: y = x(2 + x)/2
Let's see if this works:
x = 2: y = 2(2 + 2)/2 = 4 <--- Each y value is exactly 2 times too big.
x = 4: y = 4(2 + 4)/2 = 12
x = 6: y = 6(2 + 6)/2 = 24
...
x = 16: y = 16(2 + 16)/2 = 144
---> If the formula were corect it would be: y = x(2 + x)/2
But the formula gives answers which are 2 times too big, so we have to divide that formula by 2:
---> y = x(2 + x)/4 <---
The series 2 + 4 + 6 + 8 (etc) is an arithmetic series and you want its sum.
The formula for an arithmetic series is: Sum = N(F + L)/2
where N = number of terms F = first term L = last term
Each sum starts with 2, so F = 2.
The value for N is x.
Also, the last term is x, so L = x
The sum then is: y = x(2 + x)/2
Let's see if this works:
x = 2: y = 2(2 + 2)/2 = 4 <--- Each y value is exactly 2 times too big.
x = 4: y = 4(2 + 4)/2 = 12
x = 6: y = 6(2 + 6)/2 = 24
...
x = 16: y = 16(2 + 16)/2 = 144
---> If the formula were corect it would be: y = x(2 + x)/2
But the formula gives answers which are 2 times too big, so we have to divide that formula by 2:
---> y = x(2 + x)/4 <---