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$[0], T$[1], T$[2] 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$[0] then exchange i-th digits as T$[1]. (i-1)-digit through 1-digits remain the same. If i-th digit is T$[1] then exchange i-th digits as T$[2]. (i-1)-digit through 1-digits remain the same. If i-th digit is T$[2] then exchange i-th digits as T$[0]. i=i-1 : gosub # If i=0 then concatinate T$[0] at the uppermost digit. If T$[0]=0 then concatinate T$[1] 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
power | a | b=ap |
---|---|---|
3 | 7 | 343 |
11 | 1331 | |
14 | 2744 | |
15 | 3375 | |
36 | 46656 | |
62 | 238328 | |
92 | 778688 | |
173 | 5177717 | |
192 | 7077888 | |
211 | 9393931 | |
888 | 700227072 | |
3543 | 44474744007 | |
110011 | 1331399339931331 | |
146796 | 3163316636166336 | |
4 | 9 | 6561 |
11 | 14641 | |
16 | 65536 | |
34 | 1336336 | |
5 | 6 | 7776 |
23 | 6436343 | |
6 | 6 | 46656 |
8 | 3 | 6561 |
4 | 65536 | |
11 | 3 | 177147 |
16 | 2 | 65536 |
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.
previous | index |
---|