TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal Schmidt
from: Jasen Betts
date: 2004-03-30 16:40:32
subject: squares

Hi Pascal.

29-Mar-04 17:02:12, Pascal Schmidt wrote to Jasen Betts


 PS> Hi Jasen! :-)

 JB>> are there shorcuts to tell if a big integer (bignum) is not a square?
 JB>> (like without trying to square-root it.)
 PS> Well, for integers, the last digit of any square is produced by squaring 
 PS> the 
 PS> last digit of the square-root (modulo 10)

 PS> Thus, no integer ending in 2, 3, 7, or 8 can be the square of any other
 PS> integer. This reduces the problem space by 40%. ;)

hmm, to do that I'd need to divide by 10...

but I find that there's only 44 last-bytes in the binary representation....

which can be done without division and reduces the problem space reduces
it by about 82%

but it seems though that the more terminal bits I examine the less
cost-effective it becomes.

 -=> Bye <=-

---
* Origin: If at first you don't succeed, the hell with it. (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.