MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Arithmetic Puzzle (so simple it's hard)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71339] Re: Arithmetic Puzzle (so simple it's hard)
  • From: "Ray Koopman" <koopman at sfu.ca>
  • Date: Wed, 15 Nov 2006 06:43:57 -0500 (EST)
  • References: <ejc4pv$6nf$1@smc.vnet.net>

Bruce Colletti wrote:
> How would this problem be solved in Mathematica?
>
> BUT * ASK = FEAST, where each letter is a 1-digit number, no two letters may stand for the same number, and the letters are in {0,1,2,4,5,6,7,9}.
>
> Thankx.
>
> Bruce

Try brute force:

With[{letters = {"a","b","e","f","k","s","t","u"}},
Scan[If[FromDigits[{"b","u","t"}/.Thread[letters -> #]] *
        FromDigits[{"a","s","k"}/.Thread[letters -> #]] ==
        FromDigits[{"f","e","a","s","t"}/.Thread[letters -> #]],
        Print[letters -> #]]&,
     Permutations@{0,1,2,4,5,6,7,9}]]

{a,b,e,f,k,s,t,u} -> {1,6,5,9,2,4,0,7}

{a,b,e,f,k,s,t,u} -> {4,0,7,2,1,9,6,5}


  • Prev by Date: Re: List difference using patterns and substitutions.
  • Next by Date: About NIntegrate
  • Previous by thread: Re: Arithmetic Puzzle (so simple it's hard)
  • Next by thread: Re: Arithmetic Puzzle (so simple it's hard)