1. ## Find the Formula

1 Apple = (£3.00 + (n x £1.00) ) * P
1 Date = (£3.50 + (n x £1.20) ) * P
1 Chilli = (£3.25 + (n x £1.10) ) * P
1 Mango = (£2.50 + (n x £0.80) ) * P

Where n = the number you already have.
and P = your current amount / the maximum amount

If I have 5 Apples, and the maximum amount is 10

Cost of buying 1 apple =
= 3.00 + (5 * 1.00) * 5/10
= 8.00 * 0.5
= £4.00

Cost of buying 2 apples (6th and 7th)
=[ 3.00 + (5 * 1.00) * 5/10 ] + [ 3.00 + (6 * 1.00) * 6/10 ]
=(8.00 * 0.5) + (9.00 * 0.6)
=£9.40

Cost of buying all 5 apples (6th, 7th, 8th, 9th, 10th)
=(8 * 0.5) + (9 * 0.6) + (10 * 0.7) + (11 * 0.8) + (12 * 0.9)
=4.00 + 5.40 + 7.00 + 8.80 + 10.80
=£36.00

But how do I put that into a formula that will work for apples, dates, chillis and mangos When the values will be much larger.
Example

Cost of buying 999 apples when;
Current apples = 1500
Maximum apple = 2700

Cost of buying 899 mangos when;
Current mangos = 2601
Maximum mango = 3500

Edit:
If a minimum value is needed, P can't drop below 0.1
So.
If Current/Maximum < 0.1 : P = 0.1

2. Did I put this is the wrong place? or just no-one has any ideas?

Im pretty stuck trying to figure it out

3. 1 Apple = £3.00 + (n x £1.00) * P
1 Date = £3.50 + (n x £1.20) * P
1 Chilli = £3.25 + (n x £1.10) * P
1 Mango = £2.50 + (n x £0.80) * P

Where n = the number you already have.
and P = your current amount / the maximum amount

If I have 5 Apples, and the maximum amount is 10

Cost of buying 1 apple =
= 3.00 + (5 * 1.00) * 5/10
= 8.00 * 0.5
= £4.00

Cost of buying 2 apples (6th and 7th)
=[ 3.00 + (5 * 1.00) * 5/10 ] + [ 3.00 + (6 * 1.00) * 6/10 ]
=(8.00 * 0.5) + (9.00 * 0.6)
=£9.40

Cost of buying all 5 apples (6th, 7th, 8th, 9th, 10th)
=(8 * 0.5) + (9 * 0.6) + (10 * 0.7) + (11 * 0.8) + (12 * 0.9)
=4.00 + 5.40 + 7.00 + 8.80 + 10.80
=£36.00

But how do I put that into a formula that will work for apples, dates, chillis and mangos When the values will be much larger.
Example

Cost of buying 999 apples when;
Current apples = 1500
Maximum apple = 2700

Cost of buying 899 mangos when;
Current mangos = 2601
Maximum mango = 3500

Edit:
If a minimum value is needed, P can't drop below 0.1
So.
If Current/Maximum < 0.1 : P = 0.1
hi
first you have placed brackets wrongly, its very confusing
1 Apple = £3.00 + (n x £1.00) * P
it should be
1 Apple = (£3.00 + (n x £1.00) )* P
But how do I put that into a formula that will work for apples, dates, chillis and mangos When the values will be much larger.
you have to calculate by yourself
If a minimum value is needed, P can't drop below 0.1
So.
If Current/Maximum < 0.1 : P = 0.1
what this for?????what you need in this???

4. Originally Posted by ursa
hi
first you have placed brackets wrongly, its very confusing

it should be
1 Apple = (£3.00 + (n x £1.00) )* P

you have to calculate by yourself

what this for?????what you need in this???
sorry about the brackets, my mistake. Changed it in original post

I thought a minimum value might be needed because while I was trying to work it out, I tried to do a sum of all the values, but it didnt work, because the minimum P is 0.1

Is there no way to create a formula for this then?
i started working on this without the P multiplier, which was simple arithmetic progression, and I thought I was just so used to using that I couldn't find the way to introduce P into the equation.

Before P;
Sn = (n/2) * ( 2a + (n-1)d)

But when I had to introduce P
I tried (Sn) * (average of P)
but that way doesn't take into account the larger P multiplied by the growing d, so doesnt give an accurate figure.

then I tried;

[(n * a) * average P] + (an arithmetic progression with a variable d)

but I'm pretty sure you cant have d as a variable in an arithmetic series

5. sorry about the brackets, my mistake. Changed it in original post

I thought a minimum value might be needed because while I was trying to work it out, I tried to do a sum of all the values, but it didnt work, because the minimum P is 0.1

Is there no way to create a formula for this then?
i started working on this without the P multiplier, which was simple arithmetic progression, and I thought I was just so used to using that I couldn't find the way to introduce P into the equation.

Before P;
Sn = (n/2) * ( 2a + (n-1)d)

But when I had to introduce P
I tried (Sn) * (average of P)
but that way doesn't take into account the larger P multiplied by the growing d, so doesnt give an accurate figure.

then I tried;

[(n * a) * average P] + (an arithmetic progression with a variable d)

but I'm pretty sure you cant have d as a variable in an arithmetic series
if u need a formula then you can try this one, its a bit complicated
and only for
1 Apple = (£3.00 + (n x £1.00) ) * P
( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(n+2))/6) )/m
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount

6. Originally Posted by ursa
if u need a formula then you can try this one, its a bit complicated
and only for

( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(n+2))/6) )/m
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount
Current = 5
Want = 5 more
top = 10

( ((5^2 + 5 -2)5) + (((2*5 + 1)(5)(5+1))/2) + (((5)(5+1)(5+2))/6) )/10

((28*5) + ((11 * 5 * 6)/2) + ((5*6*7)/6) /10

(140 + 165 + 35) /10

=34

Should be 36?

and I think what Ive been doing is wrong, seen as I seem to be going down a completely different line.

7. Current = 5
Want = 5 more
top = 10

( ((5^2 + 5 -2)5) + (((2*5 + 1)(5)(5+1))/2) + (((5)(5+1)(5+2))/6) )/10

((28*5) + ((11 * 5 * 6)/2) + ((5*6*7)/6) /10

(140 + 165 + 35) /10

=34

Should be 36?

and I think what Ive been doing is wrong, seen as I seem to be going down a completely different line.
oh
i m sorry
i typed wrong formula
actually it is

( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(2n+1))/6) )/m
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount

now try.

8. Current = 5
Want = 5 more
top = 10

( ((5^2 + 5 -2)5) + (((2*5 + 1)(5)(5+1))/2) + (((5)(5+1)(2*5+1))/6) )/10

((28*5) + (11*5*6/2) + (5*6*11/6) )/10

(140 + 165 + 55) /10

=36 cool =)
Thanks for the help

Just to test

When
Current = 1500
Want = 200 more
top = 2900
Should cost £177,002.2069

( ((1500^2 + 1500 -2)200) + (((2*1500 + 1)(200)(200+1))/2) + (((200)(200+1)(2*200+1))/6) )/2900
(450299600 + 60320100 + 2686700) / 2900
=£177002.20689

Sweet, thanks again
Apples, £3.00 £1.00
-----------

hmm, so why doesnt it work for the others?

Mango, £2.50 £0.80
Current = 5
Want = 5 more
top = 10

= 2.50 + (5 * 0.80) * 5/10
= 6.50 * 0.5
= £3.25

Cost of buying 2 mangos (6th and 7th)
=[ 2.50 + (5 * 0.80) * 5/10 ] + [ 2.50 + (6 * 0.80) * 6/10 ]
=(6.50 * 0.5) + (7.30 * 0.6)
=£7.63

Cost of buying all 5 mangos (6th, 7th, 8th, 9th, 10th)
=(6.5 * 0.5) + (7.3 * 0.6) + (8.1 * 0.7) + (8.9 * 0.8) + (9.7 * 0.9)
=3.25+4.38+5.67+7.12+8.73
=£20.42

( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(2n+1))/6) )/m
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount

*works on it*

9. c->Current no. of apples in our hand
n->No. of apple to be buy
t->Total allowed
a->original cost of food
d->changing cost

Ive got it to

When n=2 [ a( c + (c+1) ) + d( c^2 + (c+1)^2 ) ] /t
When n=3 [ a( c + (c+1) + (c+2) ) + d( c^2 + (c+1)^2 + (c+2)^2) ] /t
When n=4 [ a( c + (c+1) + (c+2) + (c+3) ) + d( c^2 + (c+1)^2 + (c+2)^2 + (c+3)^2) ] /t

So
Sn = [ a( nc + ( n(n-1)/2 ) ) + d( n(c^2) + (n^2 - n) + ???? ) ] /t

Im unsure how to finish the equation... so close..
should be;
+1 when n=2
+5 when n=3
+14 when n=4
+30 when n=5
+55 when n=6

10. Sn = [ a( nc + ( n(n-1)/2 ) ) + d( n(c^2) + (n^2 - n) + ???? ) ] /t
You appear to have done quite well so far. So well, in fact, that the only thing I think I need to tell you is that
$\displaystyle 1^2+2^2+3^2+4^2...+n^2 = \frac{n(n+1)(2n+1)}{6}$

You appear to have done quite well so far. So well, in fact, that the only thing I think I need to tell you is that
$\displaystyle 1^2+2^2+3^2+4^2...+n^2 = \frac{n(n+1)(2n+1)}{6}$
That gives;
+1 when n=1
+5 when n=2
+14 when n=3
+30 when n=4
+55 when n=5

I need
+1 when n=2
+5 when n=3
+14 when n=4
+30 when n=5
+55 when n=6

$\displaystyle \frac{n(n-1)(2-1)}{6}$ works

cheers for the help

Now the formula is;
$\displaystyle [an(c+\frac{n-1}{2}) + dcn(c+n-1) + (\frac{n(n-1)(2-1)}{6})] /t$

Thanks for the help =D

12. You probably just made a mistake typing this out, but since it appeared twice in your post I thought I had better point out that there is an n missing in this. It should read
$\displaystyle [an(c+\frac{n-1}{2}) + dcn(c+n-1) + (\frac{n(n-1)(2n-1)}{6})] /t$