I was fooling around with this today (avoiding fixing the oven, I'm sure I'll have to pay for that soon), and I found an interesting twist on this series. I wasn't (not having noticed or been around for the previous round that Paul mentioned) quite sure how the series for 1/3 might have been derived, so I was trying to come up with a demonstration of it, hoping I could find a general formula. I had this gut feeling that the series Myke listed had popped out of an Euler transformation somehow, and I was fooling around with that. What I noticed, however, was that if the Euler transformation was applied backward of what I had first thought (and I'm not this smart, this is an immediate consequence of a derivaton in R.W. Hamming's book on Numerical Methods, section 12.6, on page 203 of the Dover edition), that you can improve the convergence of such a series while still working exclusively with powers of two. In particular, the series 1/2 * ( 1/4 + 1/16 + 1/64 + 1/256 + ... + 1/(4^n) + ... ) Also converges to 1/3, but at a much quicker rate. I calculated the two series in Excel to demonstrate: Index Myke's Series Powers of 1/4 1 0.5 0.25 2 0.25 0.3125 3 0.375 0.328125 4 0.3125 0.33203125 5 0.34375 0.333007813 6 0.328125 0.333251953 7 0.3359375 0.333312988 8 0.33203125 0.333328247 9 0.333984375 0.333332062 10 0.333007813 0.333333015 11 0.333496094 0.333333254 12 0.333251953 0.333333313 13 0.333374023 0.333333328 14 0.333312988 0.333333332 15 0.333343506 0.333333333 16 0.333328247 0.333333333 17 0.333335876 0.333333333 18 0.333332062 0.333333333 19 0.333333969 0.333333333 20 0.333333015 0.333333333 21 0.333333492 0.333333333 22 0.333333254 0.333333333 23 0.333333373 0.333333333 24 0.333333313 0.333333333 25 0.333333343 0.333333333 26 0.333333328 0.333333333 27 0.333333336 0.333333333 28 0.333333332 0.333333333 29 0.333333334 0.333333333 30 0.333333333 0.333333333 31 0.333333333 0.333333333 Thus, the replacement series requires almost exactly half as many terms to achieve the same degree of accuracy. Not that this answers Myke's question, but I thought it was kind of useful. I suppose I really should try to fix the oven before my wife starts getting cranky. --Bob On Sat, Jul 24, 1999 at 09:36:03AM -0400, Myke Predko wrote: > Hi Folks, > > Quick question for the Math Wizzes out there. > > Is there a series method of doing a divide by a constant? I'm thinking of > the divide by three operation: > > n/3 = x/2 - x/4 + x/8 - x/16 + x/32 - x/64... > > which is very easy to code and is very fast. Of course, powers of two work > the same way. > > Is there a general case for non-powers of two? > > I got asked for a routine which needs a divide by seven and wondered if > there was a better way of doing it instead of the methods which use a > variable. > > Thanx, > > myke -- ============================================================ Bob Drzyzgula It's not a problem bob@drzyzgula.org until something bad happens ============================================================