.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #51  
Old September 23rd, 2004, 02:25 AM
Jack Simth's Avatar

Jack Simth Jack Simth is offline
Major General
 
Join Date: Oct 2002
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
Jack Simth is on a distinguished road
Default Re: OT: Interesting math problem...

Narf: Mostly using an iteritive Version of the function I posted earlier; although it does have issues if you feed it 0 or a negative number. There is no cut and dry one line, one pass equation to get a square root using the basic four functions (*/+-)

Kamog: that method works based on geometry. First, consider a 1x1 square of selected numerals:
Code:

1


Notice that there is one 1. In order to expand the square to a 2x2 grid, you need to add in 3 places: one above (or below) the existing 1, one left (or right) of the one, and another to fill in the corner three of them:
Code:

33
13


Suppose that we want to expand it further to a 3x3; we need to add two above (or below), two to the left (or right) and one in the corner 5 of them:
Code:

555
335
135


To generalize this, to get a square of size (N+1)x(N+1) from a square of size NxN, you need to add 2*N + 1 squares. (note that this works from a 0x0 - 2*0 + 1 = 1). In subtracting progressivly greater odd numbers, you are reversing the process - first you take out one square:
Code:

555
335
35


Then you take out three squares:
Code:

555
5
5


Then you take out five squares:
Code:






Once you are all out of squares, you are done.

However, those squares could also represent numbers just as easily.

__________________
Of course, by the time I finish this post, it will already be obsolete. C'est la vie.
Reply With Quote
  #52  
Old September 23rd, 2004, 03:57 AM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Interesting math problem...

Ok, so computer's use an iteritive function when you use 64^0.5?

Oh well, didn't think there would be a one-line equation.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:29 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.