In this section, I introduce the advanced technique, written in
"Computational Recreations in Mathematica", Ilan Vardi, Addison-Wesley.
The square roots of 2n-digits, (2n-1)-digits numbers are determined by upper n-digits.
So we can consider the following algorithm.
# Let a be n-digits number consisted of 3 different digits. Let c be the concatinate of a and (n-1) times 0 (c=a*10n-1). d=isqrt(c) Check (d+1)2 is consisted of 3 different digits or not. In this case, we need to check only lower n digits. (Because upper n digits is known as consisting of just 3 digits). If it is just 3 digits, found. Let c be the concatinate of a and n times 0 (c=a*10n). d=isqrt(c) Check (d+1)2 is consisted of 3 different digits or not. In this case, we need to check only lower n digits. If it is just 3 digits, found.
In this algorithm, if the digits of a increase, the search range is double-digits.
And computation time of 1 increase of a, just 3 times.
In previous algorithm's case, if the digit of a increase, computation time is getting 10 times.
So using this algorithm, we can get a great advantage.
How to generate the (#) number ?
We need to generate the following number sequencially.
The algorithm is the following.
First storing 3 digits in T$, T$, T$ from smaller number.
Let s$ be the number consisted of 3 different digits.
i is the digits (lengths).
# Noticing the i-th digit. If i-th digit is T$ then exchange i-th digits as T$. (i-1)-digit through 1-digits remain the same. If i-th digit is T$ then exchange i-th digits as T$. (i-1)-digit through 1-digits remain the same. If i-th digit is T$ then exchange i-th digits as T$. i=i-1 : gosub # If i=0 then concatinate T$ at the uppermost digit. If T$=0 then concatinate T$ at the uppermost digit.
The programs are here.
Up to a ≤ 1023 (b=a2) for patterns including zero,
and up to a ≤ 1025 for patterns not including zero has done.
Results are following;
Solutions for 013 and 678 are not found yet.
For higher powers, the results are following.
power 3 : a=10n+1 (n ≥ 2), b=a3
power 5 : a=10n+1 (n ≥ 2), b=a5
I couldn't find any solutions for power 7.
At first, the conditions
are too weak and we will be able to get the many results.
But for higher power cases, the results are only above.