invested 2000

gains 0.2 every odd numbered month
gains 0.15 every even numbered month
write function for n months?

i've tried solving this with a formula, but every formula i come up with is wrong.

Could someone tell me how to solve this and plug in the right numbers into a formula?

**i already posted this but without the % for even numbered months. should there be two different formulas for even and odd months?

For the first five months algebrically i got:

1: 2400
2: 2040
3: 2448
4: 2080.8
5: 2496.96

i tried using this formula:
2000(1+0.2)^n

when i plugged in 1 for n i got 2400.
however, when i plugged in 2 for n i got 2880. which isn't right.
so i changed the formula to 2040(1+ .2)^1 I got the right answer

but is there a simple formula where i can just plug in the "n" and get the right amount?

should i repost this?

To solve this problem, you can calculate the total gain for each month separately based on whether it is an odd or even-numbered month. Then, you can add up all the gains to find the total amount after n months.

Here's a Python function that calculates the total gain after n months using the given conditions:

```python
def calculate_total_gain(n):
total = 2000 # initial investment
for month in range(1, n+1):
if month % 2 == 1: # odd-numbered month
total += 0.2
else: # even-numbered month
total += 0.15
return total
```

To use this function, you can simply provide the number of months as an argument. For example, `calculate_total_gain(5)` will give you the total gain after 5 months.

Using this function, you don't need to rely on any specific formulas, as it directly implements the given conditions of gaining 0.2 for odd months and 0.15 for even months.