mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2012-04-28, 20:10   #12
only_human
 
only_human's Avatar
 
"Gang aft agley"
Sep 2002

2·1,877 Posts
Default

OK, after lopping off the even number of trailing 0's (if present), we have every square ending in:
001

Talking about odd squares so that we can stop talking about the trailing 0's, are there any other simple things left?

What about the next more significant bit, bit 3?
x001

I think that if it is set, that means that either bit 2 or bit 1 of the original unsquared number was set (but not not both)
That is x = b1 xor b2

So looking at sequential odd numbers, when they are squared, bit 3 is going to count like Gray Code, like this 0,1,1,0:

odd squares in sequence
1,9,25,49 in binary:
0000 0001
0000 1001
0001 1001
0011 0001

81,121,169,225 in binary:
0101 0001
0111 1001
1010 1001
1110 0001

So if someone said they were passing you odd squares in sequence, but would only let you look at bit 3, you could call them a liar if it didn't go 0,1,1,0, 0,1,1,0, ... in sequence.

Last fiddled with by only_human on 2012-04-28 at 20:23 Reason: s/Grey/Gray
only_human is offline   Reply With Quote
Old 2012-04-28, 21:33   #13
only_human
 
only_human's Avatar
 
"Gang aft agley"
Sep 2002

1110101010102 Posts
Default

So Bob has humongous squares but could only tell Alice about a few bits at the least significant end. The canny ticks Alice can try:

Lop off trailing zeroes, if any, there must be an even number of them or it is not a square

What's left must end in 001 or it is not a square.

That's about all unless Bob is juggling massive squares in sequence.

If the numbers are in sequence, bit 3 has a pattern that I mentioned above.

Quote:
Originally Posted by LaurV View Post
edit: like this ......xxxxxxx001*, where the * can be replaced with nothing, or with an even number of zeroes.
edit2: xxxx from above it is always a triangular number, so if you can test this fast... :P
As LaurV says, after lopping off any trailing zeroes and then lopping off the 001, what remains is a triangular number.

A formula for triangular numbers is (n2 + n)/2

An odd number squared:
(2n + 1)2
4(n2 + n ) + 1
or as
8(n2 + n)/2 + 1

This gives another method of calling Bob a liar because if the squares are in sequence, the triangular numbers will be in sequence too. Any two triangular numbers in sequence will add up to a square. So Alice can remember a few bits of the triangular number part and add it to the next triangular number and then apply the square tests she knows on that sum too:

odd squares in sequence
9,25,49, 81,121,169,225 in binary:
00001 001
00011 001
00110 001
01010 001
01111 001
10101 001
11100 001

The triangular numbers in the left column above are 1, 3, 6, 10, 15, 21, 28
Any adjacent triangular numbers in sequence can be added and the sum is square. After lopping off the lower bits she expects in a square, to the left of that is again a triangular number...

Last fiddled with by only_human on 2012-04-28 at 22:11 Reason: fixing some mistakes
only_human is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perfect square in Fermat al3ndaleeb Miscellaneous Math 50 2015-06-17 18:42
Next perfect square after 2^n. soumya Miscellaneous Math 1 2013-03-28 02:06
Square of Primes davar55 Puzzles 9 2008-05-21 12:54
red square Fusion_power Puzzles 14 2008-04-25 11:37
Identifing perfect squares and calculating square roots.. dsouza123 Math 2 2003-07-19 17:17

All times are UTC. The time now is 14:59.


Mon Aug 2 14:59:05 UTC 2021 up 10 days, 9:28, 0 users, load averages: 3.40, 3.14, 3.40

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.