MathGroup Archive 2003

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

Search the Archive

Re: A difficult problem


"Billy Yeung" <eg_ysyaa at stu.ust.hk> wrote in message
news:b66cuo$ftd$1 at smc.vnet.net...
> I have a difficult problem:
> Given a constant integer X (which may be very large) , you no need to find
the value of X
> and
> X mod 8 = n1
> X mod 16 = n2
> the problem is that find n2 if n1 is know?

Not so difficult!
 Suppose you write X = 8 i + (Xmod 8) and  X = 16 j + (Xmod 16) then,

  j = i/2 + (n1 - n2)/16.

Since  0 <=  n1 < 8, 0 <= n2 < 16 and j must be an integer, it is easily
shown that
for i even, n2 = n1. Whilst for i odd, n2 = n1+8.

Cheers,
  Bill




  • Prev by Date: Re: Plotting intersections
  • Next by Date: Re: Plotting intersections
  • Previous by thread: Re: A difficult problem
  • Next by thread: Plotting intersections