Substitute each capital letter in bold by a different base ten digit from 0 to 9, such that (
TAU)
.BETA when rounded off to the nearest integer is equal to
PI, and the absolute difference of (
TAU)
.BETA and
PI is the minimum. Each of
A,
P and
T is nonzero.
Notes:
(i)
PI does not represent the quantity π and,
.BETA denotes a decimal fraction.
(ii) Relevant
alphametic rules are applicable for this problem.
I used the following Qbasic code
DEF fnRound# (num#)
x1# = INT(num#)
x2# = x1# + 1
IF num# - x1# < x2# - num# THEN
fnRound# = x1#
ELSE
fnRound# = x2#
END IF
END DEF
DEF fnAbs# (num#)
IF num# >= 0 THEN
fnAbs# = num#
ELSE
fnAbs# = -num#
END IF
END DEF
CLS 0
min# = 1000000
FOR t# = 1 TO 9
FOR a# = 0 TO 9
IF a# <> t# THEN
FOR u# = 0 TO 9
IF u# <> t# AND u# <> a# THEN
FOR b# = 0 TO 9
IF b# <> t# AND b# <> a# AND b# <> u# THEN
FOR e# = 0 TO 9
IF e# <> t# AND e# <> a# AND e# <> u# AND e# <> b# THEN
tau# = 100 * t# + 10 * a# + u#
beta# = (b# / 10) + (e# / 100) + (t# / 1000) + (a# / 10000)
v1# = tau# ^ beta#
v1f# = fnRound#(v1#)
IF v1f# >= 10 AND v1f# < 100 THEN
i# = v1f# MOD 10
IF i# <> t# AND i# <> a# AND i# <> u# AND i# <> b# AND i# <> e# THEN
p# = (v1f# - i#) / 10
IF p# <> t# AND p# <> a# AND p# <> u# AND p# <> b# AND p# <> e# AND p#<>i# THEN
df# = fnAbs#(v1f# - v1#)
IF df# < min# THEN
min# = df#
PRINT tau#; beta#; v1f#; v1#; df#
END IF
END IF
END IF
END IF
END IF
NEXT e#
END IF
NEXT b#
END IF
NEXT u#
END IF
NEXT a#
NEXT t#
and go the following final minimum
tau=659 beta=0.4365 and pi=17
tau^beta=16.99978714015282
rouned that gives 17=pi
with a minimal absolute difference of 0.000212859848
|
Posted by Daniel
on 2009-09-05 12:58:55 |