MathGroup Archive 2005

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

Search the Archive

Re: Finding extra digit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54001] Re: [mg53955] Finding extra digit
  • From: yehuda ben-shimol <benshimo at bgu.ac.il>
  • Date: Sun, 6 Feb 2005 00:45:31 -0500 (EST)
  • References: <200502050815.DAA22191@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I'm not sure if you are looking for the first different digit or all of 
them, but the following will give you the second option
For example (be careful, this holds only if both n1 and n2 have the same 
number of digits)
n1 = 111111111111111122222334;
n2 = 111111111511111122222334;
then
Position[MapThread[Equal, IntegerDigits /@ {n1, n2}], False] // Flatten
Will give you all the locations of different digits (in base 10).
For the specific example it will be {10} (the 10'th digit is different).

yehuda

Zak Seidov wrote:

>Dear Math gurus,
>please help!
>What is an easy way to find extra digit in the integer n2,
>which differs from integer n1
>EXACTLY by ONE digit.
>I use a very dirt program,
>but guess that you can suggest smth (much) better.
>Thanks a lot,
>and please mail me your help
>seidovzf at yahoo.com
>
>  
>


  • Prev by Date: Re: Re: Contour Integration
  • Next by Date: Re: Vertex labeling
  • Previous by thread: Finding extra digit
  • Next by thread: Re: Finding extra digit