Nec
- 50
- 0
I have an integer A and a possitive odd integer B, can you tell me how to find a nonnegative integer C such that C<2^A and 1+BC=0(mod 2^A) ?
?
?
Sorry, I don't remember how to solve Diophantine equations off the top of my head. Anyways, where's the brain teaser?Nec said:I have an integer A and a possitive odd integer B, can you tell me how to find a nonnegative integer C such that C<2^A and 1+BC=0(mod 2^A)
As C is bounded, I would use a loopNec said:I have an integer A and a possitive odd integer B, can you tell me how to find a nonnegative integer C such that C<2^A and 1+BC=0(mod 2^A) ?
?
CLOCK-->---------(E)->COUNTER(C) REGISTER(B)
E | | |
^ | | |
| | v v
| ----(E)------------>MULTIPLiER
| |
| |
-----------<-----------------------(AND)
I already put you into my list of top 10 ! --smile--Gokul43201 said:If you have A = 4, 2^A = 16.
Any odd B is 4k+1 or 4k-1. Choose C to be the other of the pair.
So, 1+BC = 1+ (4k+1)(4k-1) = 16k^2 == 0 (mod 16)
Looking for a general solution for all A.