MathGroup Archive 2005

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

Search the Archive

Re: Finding extra digit

  • To: mathgroup at
  • Subject: [mg54015] Re: Finding extra digit
  • From: Bill Rowe <readnewsciv at>
  • Date: Mon, 7 Feb 2005 03:13:11 -0500 (EST)
  • Sender: owner-wri-mathgroup 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

  • Prev by Date: DLL in windows, Palettes running procedures silently
  • Next by Date: Problem using Evaluate[] inside a Plot command. 5.1
  • Previous by thread: Re: Finding extra digit
  • Next by thread: Re: Finding extra digit