home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / math / 9632 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  1.5 KB

  1. Path: sparky!uunet!mcsun!uknet!strath-cs!st-and!tgw
  2. From: tgw@st-andrews.ac.uk (Trevor Gordon Walker)
  3. Newsgroups: sci.math
  4. Subject: Re: Square roots
  5. Message-ID: <1992Jul29.145036.24876@st-andrews.ac.uk>
  6. Date: 29 Jul 92 14:50:36 GMT
  7. References: <Bs4HD3.ID5@usenet.ucs.indiana.edu>
  8. Followup-To: sci.math
  9. Organization: St. Andrews University
  10. Lines: 35
  11.  
  12. In article <Bs4HD3.ID5@usenet.ucs.indiana.edu> hpassaue@silver.ucs.indiana.edu (Billy Passauer) writes:
  13. >I ran across this algorithm for finding the square root of a number a
  14. >long time ago.  I was wondering if someone could tell me where I could
  15. >find more information about it.
  16. >
  17. >To find the INTEGER portion of a square root:
  18. >  Take the number you want the square root of, and successively
  19. >subtract the odd numbers (starting with 1.)  Each time the result is
  20. >positive, add 1 to a counter.  Repeat with the new number.  When the
  21. >subtraction yields an odd number, the counter contains the answer.
  22. >(integer only)  For instance the square root of 24:
  23. >
  24. >                  Counter
  25. >    24 - 1 = 23  :   1
  26. >    23 - 3 = 20  :   2
  27. >    20 - 5 = 15  :   3
  28. >    15 - 7 =  8  :   4
  29. >     8 - 9 = <0 
  30. >
  31. >Any information about this would be greatly appreciated.
  32. >-- 
  33. >  _
  34. > /_)  *  /    /    /  /     hpassaue@silver.ucs.indiana.edu
  35. >/__) /  (__  (__  (__/      hpassaue@ucs.indiana.edu
  36. >     Passauer    ___/
  37.  
  38. This is a consequence of the fact that the sum of the first n odd 
  39. numbers is n^2, which is easily proved by induction.
  40.  
  41. I must admit I had never thought of using the fact in this context,
  42. though.
  43.  
  44.         Trevor
  45. trevor@cs.st-and.ac.uk
  46. tgw@st-and.ac.uk
  47.