Calculating Numbers

Martin Blackman martinblackman at gmail.com
Tue May 22 03:33:00 EDT 2007


Simplest suggestion is an arithmetic series
Each term of the series increases (or decreases) by a constant amount

You need the series to sum to 180 (to go from 75 to 255)
For n terms the sum is 0.5*n*(a[1]+a[n])
Therefore for 30 terms, a[30]=12-a[1]
Also, a[n]=a[1]+d*(n-1) where d is the constant increment
Therefore a[30]=a[1]+29*d
and thus d=(12-2*a[1])/29

There is an infinite variety of starting numbers and increments to get
you to the final destination.  For example, pick a[1]=11, then d=
-0.3448. Or pick d=-1, then a[1]=20.5.  But there is a caveat in that
your terms can go negative, I presume you want to keep them positive
so you need to have
a[30]=12-a[1]>0
ie, a[1]<12

regards,
Martin

P.S., mathworld.wolfram.com is your friend for anything like this


>
> In other words, say I start with 75 and I know I want to have 30 steps
> between 75 and 255 that get progressively smaller down to 1. How I determine
> the value of each step?



More information about the use-livecode mailing list