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.
For odd n and black corners:
n^3 -8n^2 + 15n + 4 + 4[sum of odd triangular numbers up to n-2]
For odd n and white corners:
n^3 -8n^2 + 17n + 4 + 4[sum of even triangular numbers up to n-3] + 2[n-1st triangular number]
Note: the two odd formulas add to twice the even formula
Edited on April 3, 2023, 12:18 pm