Somehow related to HP Calculators
|
01-04-2022, 03:08 PM
Post: #5
|
|||
|
|||
RE: Somehow related to HP Calculators
(01-04-2022 01:49 PM)albertofenini Wrote: Let's make an example, starting salary is 10.000 To get 6 paid raises, employee had to work 7 years: total earnings = 10000+77000 = 87000 Also, odd and even years have different paid raise formulas Let s0 = starting salary, with 2n paid raises Cumulative company paid to employee (worked 2n+1 years) = s0 * (2n+1) + sum(500*k*k, k=1..n) + sum(500*k*(k+1), k=1..n) = s0 * (2n+1) + 500 * sum(2k^2 + k, k=1..n) = s0 * (2n+1) + 500 * (2*n*(n+1)*(2n+1)/6 + n*(n+1)/2) = s0 * (2n+1) + 250 * n * (n+1) * (4n+5) / 3 For example, for working 7 years (n=3): CAS> (s0*(2n+1) + 250*n*(n+1)*(4n+5)/3) (s0=10000, n=3) → 87000 For completeness, if employee worked even years: Cumulative company paid to employee (worked 2n years) = s0 * (2n+1) + 250 * n * (n+1) * (4n+5) / 3 - (s0 + 500*n*(n+1)) = s0 * 2n + 250 * n * (n+1) * (4n-1) / 3 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)