A palindromic binary square is a square number in binary that remains the same when its digits are reversed (with no leading zeros). For example, 1 1 2 2 = 1 0 0 1 2 is a palindromic binary square.
Use a computer program to find the next smallest palindromic binary square, and convert that square to base- 1 0 for your final submitted answer.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
These numbers grow rather quickly; here's the OEIS entry for reference, and here's the graph . The logarithmic scale plot shows some interesting structure.
1 |
|
Here is my C++ code. It is worth to mention, that the entire computation is done at the compile time. I used gcc 9.2 with -std=c++17.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
The following is the most Naive implementation.
The next smallest square must be in the form of N 2 for integer N > 3 .
We will convert the perfect square N 2 into a binary number , then check if it's a palindrome or not. If it's not, we increase N by 1. We execute this task until a solution is found.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Problem Loading...
Note Loading...
Set Loading...
The Mathematica function
coupled with the command
gives
so the answer is 4 5 2 3 2 = 2 0 4 5 7 5 2 9 .