All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
An infinite chessboard (Posted on 2005-10-28) Difficulty: 2 of 5
The squares of an infinite chessboard are numbered successively as follows: in the lower left corner (first row, first column) we put 0 (zero), and then in every other square we put the smallest nonnegative integer that does not appear to its left in the same row or below it in the same column. See it partially filled:
            |   |   |   |   |   |   |   |   |
            +---+---+---+---+---+---+---+---+--
            | 5 |   |   |   |   |   |   |   |
            +---+---+---+---+---+---+---+---+--
            | 4 | 5 |   |   |   |   |   |   |
            +---+---+---+---+---+---+---+---+--
            | 3 | 2 | 1 |   |   |   |   |   |
            +---+---+---+---+---+---+---+---+--
            | 2 | 3 | 0 | 1 |   |   |   |   | 
            +---+---+---+---+---+---+---+---+--
            | 1 | 0 | 3 | 2 | 5 |   |   |   |
            +---+---+---+---+---+---+---+---+--
            | 0 | 1 | 2 | 3 | 4 | 5 |   |   | 
            +---+---+---+---+---+---+---+---+--
Find the law that rules the numbers that fills the chessboard, so that in seconds, you can evaluate the number that is, for example, in the intersection of the 1000th row and the 100th column.

See The Solution Submitted by pcbouhid    
Rating: 3.4286 (7 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution answer | Comment 4 of 27 |
I don't understand Josh70679's answer. But maybe this is what he meant, since I agree with his result.

Assuming that this is a 0-based chessboard (by that I mean, that F(0,0)=0, F(3,1)=2, F(3,2)=1, etc...), and

Where | = the bitwise or operator... the value of a cell is given by:

F(x,y) = 2*(x|y) - (x+y)

also read as 2 times the bitwise result of x OR y less the sum of x and y.

the value at the 1000th row and 100th column would be F(99,999) would be 900.
Edited on October 28, 2005, 2:40 pm
  Posted by SilverKnight on 2005-10-28 14:34:43
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (23)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information