What is the rule for this function?

INPUT OUTPUT
1 2
2 5
3 9
4 14
5 20
6 27

It's easier to see this way:

Input 1, Output 2
Input 2, Output 5
Input 3, Output 9
Input 4, Output 14
Input 5, Output 20
Input 6, Output 27

If you add the first n integers, you have

1,3,6,10,15,21
We have this same sequence, starting at the 2nd term, less 1.

So, since 1+2+3+...+n = n(n+1)/2, we have

(n+1)(n+2)/2 - 1

Steve, you are AWESOME! Thank you so much.

Please explain:
"If you add the first n integers, you have
1,3,6,10,15,21
We have this same sequence, starting at the 2nd term, less 1."

The sum of the first n integers is one of the basic formulas that you learn when studying mathematical induction. If you haven't seen it, I'm not surprised you are confused.

If Tn is the nth term of the sequence,

Tn = n, and 1+2+3+...+n = n(n+1)/2
We have

Tn = n+1, so
2+3+4+...+n+(n+1) = (1+1)+(2+1)+(3+1)+...+(n+1)
= (1+2+3+...+n) + (1+1+1..) <n times>
= n(n+1)/2 + n
= (n^2+n+2n)/2 = (n^2+3n)/2
= (n^2+3n+2)/2 - 2/2
= (n+1)(n+2)/2 - 1

Actually, I kinda like n(n+3)/2 better, but (n+1)(n+2)-1 shows it's the sum of the first n+1 integers, less the first term (1).

If you had to do this from scratch, it's worth noting that

1+1+1+1... = n adding a constant n times is just a multiple of n
1+3+5+7+... = 1,4,9,16,... = n^2
adding a steadily increasing sequence gives a quadratic

So, in this problem, we'd have guessed a general quadratic an^2+bn+c, and plugging in n=1,2,3 we'd have had

#1. a+b+c = 2
#2. 4a+2b+c = 5
#3. 9a+3b+c = 9

subtracting #1 from #2 and #3 gives

#1' 3a+b=3
#2' 8a+2b=7
or,
6a+2b=6
8a+2b=7
so,
2a=1
a = 1/2
working backwards, we get
b = 3/2
c = 0

so, we have 1/2 n^2 + 3/2 n = n(n+3)/2

To determine the rule for this function, we need to look for a pattern in the input-output pairs.

Looking at the outputs, we can see that each output is obtained by adding a certain number to the previous output. Let's calculate the differences between consecutive outputs:

2 - 0 = 2
5 - 2 = 3
9 - 5 = 4
14 - 9 = 5
20 - 14 = 6
27 - 20 = 7

The differences between consecutive outputs are increasing by 1 each time. This indicates that the rule for this function involves adding consecutive numbers as the input increases.

Now, let's calculate the differences between consecutive inputs:

2 - 1 = 1
3 - 2 = 1
4 - 3 = 1
5 - 4 = 1
6 - 5 = 1

The differences between consecutive inputs are all 1. This suggests that the rule involves adding the input to the sum of consecutive numbers.

From this pattern, we can determine that the rule for this function is:
OUTPUT = INPUT + (SUM OF CONSECUTIVE NUMBERS FROM 1 TO (INPUT-1))

To find the output for a given input, we just need to calculate the sum of consecutive numbers from 1 to (input - 1) and add it to the input.

For example, for an input of 1:
The sum of consecutive numbers from 1 to (1-1) is 0.
So, the output is 1 + 0 = 1.

For an input of 3:
The sum of consecutive numbers from 1 to (3-1) is 1 + 2 = 3.
So, the output is 3 + 3 = 6.

Applying this rule to all the given inputs, we can verify that it produces the correct outputs:

1 + (0) = 1
2 + (1 + 0) = 2 + 1 = 3
3 + (1 + 2) = 3 + 3 = 6
4 + (1 + 2 + 3) = 4 + 6 = 10
5 + (1 + 2 + 3 + 4) = 5 + 10 = 15
6 + (1 + 2 + 3 + 4 + 5) = 6 + 15 = 21

So, the rule for this function is OUTPUT = INPUT + (SUM OF CONSECUTIVE NUMBERS FROM 1 TO (INPUT-1)).