MathGroup Archive 2005

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

Search the Archive

Re: Finding extra digit

  • To: mathgroup at
  • Subject: [mg54033] Re: Finding extra digit
  • From: "Steve Luttrell" <steve_usenet at>
  • Date: Tue, 8 Feb 2005 05:31:11 -0500 (EST)
  • References: <cu78mn$m7l$>
  • Sender: owner-wri-mathgroup at

"Bill Rowe" <readnewsciv at> wrote in message 
news:cu78mn$m7l$1 at
> On 2/6/05 at 12:44 AM, steve_usenet at
> (Steve Luttrell) wrote:
>>This example does the sort of thing you want:
>>Define a couple if integers differing by one digit.
>>Split the integers into their component digits. In[2]:=
>>{d1,d2}=Map[IntegerDigits,{n1,n2}] Out[2]=
>>Find the digits the integers have in common In[3]:=
>>i=Intersection[d1,d2] Out[3]= {1,2,3,4,5,6}
>>Find which digits of n2 do NOT lie in the above common set. In[4]:=
>>Complement[d2,i] Out[4]= {8}
> This will not work in general. For example, condider n1 = 811 and n2 =818. 
> The two integers differ by one digit. But since both are composed from the 
> same digits, there are no unique digits in either number.
> --
> To reply via email subtract one hundred and four

Agreed. I am not doing a digit by digit comparison as I should have done. In 
effect I have shattered the two numbers into their component digits before I 
start, and then I am comparing these two sets.

Steve Luttrell 

  • Prev by Date: Re: FullSimplify and out of memory
  • Next by Date: bugs in Mathematica 5.1
  • Previous by thread: Re: Finding extra digit
  • Next by thread: Re: Finding extra digit