20080306, 22:18  #1 
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
11B9_{16} Posts 
"ODD" Square root Algorithm
Odd to me anyway ... some of you may be familiar with it or why it works.
http://pullmoll.stop1984.com/sqrt.html 
20080308, 20:45  #2  
Feb 2007
2^{4}·3^{3} Posts 
Quote:
Quote:


20080308, 22:49  #3 
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
13·349 Posts 
Yes I did in fact read that but didn't take enough time to absorb how that extends to the algorithm he describes.
For example to calculate sqrt(1024) only requires adding 1+3+5 and later 61+63, rather than all odds from 1 to 63. (1+3+5) * 100 = 900 = sum of odds to 60. Cool... As I continue to investigate it starts to make sense .... so let me at it for a while and I'll be fine. Thanks 
20080315, 07:35  #4 
Nov 2005
2×7×13 Posts 
Do I understand right? That this is based on this formula for quadratics:
(n+1)^2=n^2+2n+1; let m=n+1 m^2n^21=2n Thus consecutive squares are always 2n+1 appart. That formule you mentioned is equivilent to this code: Code:
Let x = 0 For i = 1 to n x = x + i + i  1 Next i REM Returns in x, the square of n using recursive addition instead of multiplication. Code:
Let x=0 For i = 1 to n x = x + i + i Next i x = x  n Let x = 2 * n * (n + 1) / 2  n Or: Code:
Let x = n * (n + 1)  n Code:
Let x = n^2 + n  n EDIT: You should note that for m=n+1: m^3  n^3  1 = (n+1)^3  n^3  1 = n^3 + 3n^2 + 3n + 1  n^3  1 = 3(n^2 + n) = 3n(n+1) Last fiddled with by nibble4bits on 20080315 at 07:44 Reason: Added note 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
AouessareEl HaddouchiEssaaidi "test": "if Mp has no factor, it is prime!"  wildrabbitt  Miscellaneous Math  11  20150306 08:17 
Primo quit with "Candidate is presumably a square"  lavalamp  Software  12  20110609 19:27 
Fastest possible algorithm to calculate the square root of a 10,000,000 digit number  Fusion_power  Math  19  20071102 21:37 
Would Minimizing "iterations between results file" may reveal "is not prime" earlier?  nitai1999  Software  7  20040826 18:12 