The number 101 is a palindrome, since it reads the same backwards and forwards. The number 105 is not. However, 105 in base eight is written as 151, which is palindromic. On the other hand, 103 is not a palindrome in any base from 2 to 101. Hence, 103 is strictly non-palindromic.
The precise definition is: A nonnegative integer n is strictly non-palindromic if it is not a palindrome in any base between 2 and n-2, inclusive.
The first few strictly non-palindromic numbers are
0, 1, 2, 3, 4, 6, 11, 19, 47, 53, 79, 103, 137, 139, 149, 163, 167, 179, 223, 263, 269... (A016038)
Write a full program that takes a number x from STDIN and prints the xth strictly non-palindromic number. For example, the input
5 would produce the output
The challenge is to write multiple (one or more) programs, each solving this task in a different language.
Then, you must put all of the programs in a rectangular grid of characters. The programs can be accessed Boggle-style. That is, go from one character to a neighboring character (including diagonally), never using the same character more than once.
For example, the following grid:
includes the words
bcdb, but not
Each program must be found in the grid using these rules. However, you may use the same character in multiple programs.
Your score is the number of characters in the grid, divided by the number of programs. Lowest score wins!
- Two languages are considered different if they usually go by different names, ignoring version numbers. For example, C and C++ are different, but Python 2 and Python 3 are the same.
- The characters in the grid must all be from printable ASCII, i.e., from
~, code points
- Each program must consist only of printable ASCII, plus newlines. When inserting a program into the grid, replace each newline with a space.
- A space in the grid may represent a space in one program and a newline in another.
- The grid must be a rectangle.
- Not every character needs to be used in a program.