I would like to calculate the spending factor in a rule where we spend Nth time the previous payment done
Here is an example of spending.
firstPaymentAmount=10
SpendingFactor=5
PaymentCount=4
payment1: 10
payment2: 50 (= 10 x 5)
payment3: 250 (= 50 x 5)
payment4: 1250 (= 250 x 5)
At the end we get the sum of all payment made and we have :
10 + 50 + 250 + 1250 = 1560
I would like to know the formula that let me retrieve the spending factor (=5 here) by only knowing these parameters:
paymentCount = 4
initalPayment = 10
totalPaid = 1560
By knowing the formula to calculate the spendingFactor, I will then be able to know the amount and detail of each payment.