Find Value

Value: 1, 3, 5, 10, 15, 21

Position: 1, 2, 3, 4, 5, 6

(The Value numbers are meant to correspond with the Position numbers above)

Value(1) at position 1 is given as 1. If position p > 1, Value is the Value at position (p-1) + p. Prompt the user for the position and print the corresponding value.

Ex:

Input:7

Output: 28

Input:10

Output: 55

Can anyone help me with figure out the mathmatical portion of this? It's confusing me so much. All I know is that the difference in the values increases by 1 at every position.

[581 byte] By [Ashley06a] at [2007-11-26 22:10:46]
# 1
This almost looks like Value(n) = 1 + 2 + 3 + ... + n
DrLaszloJamfa at 2007-7-10 10:58:33 > top of Java-index,Java Essentials,Java Programming...
# 2
Oops. The value corresponding with position 3 is supposed to be 6, not 5.
Ashley06a at 2007-7-10 10:58:33 > top of Java-index,Java Essentials,Java Programming...
# 3

> Value(1) at position 1 is given as 1. If position p > 1, Value is the Value at position (p-1) + p

This is the mathematical portion. It involves creating a recursive method. I'm sure the time in class and course materials provided ample ability to do this. You're not asking someone to do it for you are you?

By the way, I'm sure this is wrong:

Value: 1, 3, 5, 10, 15, 21

Likely it is:

Value: 1, 3, 6, 10, 15, 21

Otherwise it doesn't make sense.

warnerjaa at 2007-7-10 10:58:33 > top of Java-index,Java Essentials,Java Programming...
# 4
I already corrected myself and no... I never asked anyone to do it.
Ashley06a at 2007-7-10 10:58:33 > top of Java-index,Java Essentials,Java Programming...
# 5
> I already corrected myself and no... I never asked> anyone to do it.That's good. So case closed then, since your question was answered, right?
warnerjaa at 2007-7-10 10:58:33 > top of Java-index,Java Essentials,Java Programming...