Take a standard 8x8 chessboard, number the black squares 1 and the white squares 0. How many palindromes does this board contain in 'word-search' fashion?
Now generalize and find a formula for any n*n board.
Notes: A palindrome and its reversal should not be counted twice. A palindrome must be at least two digits long and leading zeroes are not allowed. Numbers can be read in any single vertical, horizontal or diagonal direction.
I suspect that Justin has already discovered the presence of triangular numbers.
Charlie has queried odd and even 'n'. In the horizontal and vertical situation the palindromes are the same as we may not use a leading zero to begin one.
That said, diagonals, major and minor, which are all 1's will be represented as function of the 'n' value of the board.
At present I am seeing this as a summation of a set of triangular numbers governed y the 'n' value;
ie; H_Pd's * 2 [this accounts for vertical as well]
Diagonal [consider only above the major diagonals from top to bottom on both sides, double this value to add in the mirror, and then whatever the major diagonals have to offer].
Note: each horizontal, vertical and diagonal contains a palindrome set that is 1, 3, 6, 10 ........... as far as I am able to figure. Pressing duties have and still do prevent me persuing this at this time.
|
Posted by brianjn
on 2006-06-11 08:17:22 |