In this alphametic equation, each of the capital letters in bold denotes a different base ten digit from 0 to 9, and x is any positive integer ≤ 16. None of R and T can be zero.
REKNIT 9*x
---------- = -----------
TINKER 9*x + 1
Determine the minimum value of REKNIT and maximum value of TINKER.
used Qbasic to get the the following possible values for REKNIT and TINKER
x=10989 for all values
REKNIT TINKER
197802 208791
296703 307692
395604 406593
593406 604395
692307 703296
791208 802197
Of these 197802 is the minimal value of REKNIT and 802197 is the maximum value for TINKER
my code follows:
cls 0
def fnRev(n)
ds$=str$(n)
lng=len(ds$)
rs$=""
for i=lng to 1 step -1
rs$=rs$+mid$(ds$,i,1)
next i
fnRev=val(rs$)
end def
for x=1 to 68
p=9*x
q=p+1
lmt1=int(100000/p)
lmt2=int(999999/q)
for k=lmt1 to lmt2
if fnRev(p*k)=q*k then
print p*k;q*k;k;x
end if
next k
next x
|
Posted by Daniel
on 2009-10-04 15:35:35 |