4. Computation techniques 2, results and higher power cases


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.

Infinite patterns

power 3 : a=10n+1 (n ≥ 2), b=a3
power 5 : a=10n+1 (n ≥ 2), b=a5

Sporadic patterns

powerab=ap
37343
111331
142744
153375
3646656
62238328
92778688
1735177717
1927077888
2119393931
888700227072
354344474744007
1100111331399339931331
1467963163316636166336
496561
1114641
1665536
341336336
567776
236436343
6646656
836561
465536
113177147
16265536

I couldn't find any solutions for power 7.

At first, the conditions

  1. 3 different digits
  2. perfect n-th power

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  

E-mail : kc2h-msm@asahi-net.or.jp
Hisanori Mishima