I was assigned this problem for java class and i have spent well over ten hours working on this including theory and testing.
so the problem goes like this the value for position 1 is 1, the value for position 2 is position 1 + 1*1, the value for position 3 is equal to position 2 + 2*1, the value for position 4 is equal to position 3 + 2*2 etc etc. the user needs to enter a position and you need to return the value here is an example of the math behind it
]
Position Value addition to get the next value 1 1 +1*1 2 2 +2*1 3 4 +2*2 4 8 +3*1 5 11 +3*2 6 17 +3*3 7 26 +4*1 8 30 +4*2 9 38 +4*3 10 50 +4*4 11 66 +5*1
in other terms to get from 1 -> 2
you add 1 + 1*1 = 2
to get from 2 -> 3
you add 2 + 2*1 = 4
to get from 3 -> 4
you add 4 + 2*2 = 8
to get from 4 -> 5
you add 8 + 3*1 = 11
thank you in advance for your help