Let b=a2, b is consisted of 2 different digits.
First I describe the algorithm of counting the digits in b.
Let c$ be the string of b, that is c$=cutlspc(str(b)), and d is the length of b, d=len(c$).
Align z$(10) as the saving array of each digits.
Scaning c$ from rightmost digit and repeat the following procedure.
b=a^2 : c$=cutlspc(str(b)) : d=len(c$) for i=d to 1 step -1 : f=0 : e$=mid(c$,i,1) if f=0 then inc f : z$(f)=e$ : goto * for j=1 to f if e$=z$(j) then cancel for : goto * next j inc f : z$(f)=e$ # if f>2 then cancel for : goto ** : ' greater than 2 * next i print a , b ** return
Calling above routine from main loop of a, we can get the solutions of
the arbitrary range.
The followings are the results of sporadic patterns.
a | b=a2 |
---|---|
11 12 15 21 22 |
121 144 225 441 484 |
26 38 88 109 173 |
676 1444 7744 11881 29929 |
212 235 264 3114 81619 |
44944 55225 69696 9696996 6661661161 |
Only above 15 solutions are known.
I computed the range b ≤ 1048, but couldn't find the next solution.
Above results are too depressing. So I extended the original problem as,
For "3 different digits", change the "#" line as,
if f>3
and for "perfect n-th power", change the first line as,
b=a^n.
previous | index | next |
---|