Suppose you had a 13 hour clock, labeled 0 to 12. Start at 0 and go counterclockwise 104
hours (since you went counterclockise, that's -104 hours. Youl'll find
yourself ack at 0 (since 104/13=8). But wait, we
went too far, so go clockwise 3 hours and we'll see that the clock
reads 3 for...
-------------------------------------
It's a dwarf integer.
Dammit, why does it complain that my message is too short?
Here I'm trying to post a witty response and I have to put up with this crap. Dammit, still need 4 more characters. Oh wait, I just realizes, my message was too...
Oh, I forgot to mentio: if you don't like A=1, pick another.
In a linear congruence, if A is a solution, so is A+Y,
or A+nY, for that matter. So we can chose any A, as
long as it's a multiple of four plus one.
For instance, we can pick A=1001 and recalculate B
(B=834), giving us: 1001*9...
To solve for 12345, re-arrange your formula to
(AX-M)/Y=-B
In this form, iy's a Linear Congruence, so you can use the Modular Inverse
of X&Y to find A as follows:
A = invert(X,Y)*M (mod Y) = 1*12345%4 = 1
then solve fo B: (1*9-12345)/4=-B
-3084 = -B
B = 3084
Be careful, though. You CAN...
Good. Now you know that the successor of 0mod4 is 1mod4. Now you just need to find the successor of 1mod4. When you have figured out the successor rules, you just need to find the initial state. Then, with the successor rules in hand, you can build a state machine. As uou already know, not every...
Stand on a N/S sidewalk. Call North the positive direction. Spin about
and face South (the negative direction). Now take 2 steps backwards.
That's negative motion in the negative direction, yet you end up
farther North of your starting point. Negative motion in the
negative direction yields...
Sorry abput that. The correct count was, in fact, 22. I seemed to have omitted a number in the sequence. 7894631, 789262, 15789266, 831056, 103898,
103902, 34644, 5788, 2902,2906,2910, 214, 218, 222, 84,28,22,26, 30, 20, 18, 16
I wrote a Python program that checked out to 10,000,000. Found a sequence of
length 22: 7894631,15789266,831056,103898,103902,34644,5788,2902,2906,2910,214,218,
222,84,28,22,26,30,20,18,16.
You can use a simple lookup table to convert a hex character to its binary equivalent:
0:0000 1:0001 2:0010 3:0011
4:0100 5:0101 6:0110 7:0111
8:1000 9:1001 A:1010 B:1011
C:1100 D:1101 E:1110 F:1111
Number theory would still be useful, it's just that you might not be able to make certain assumptions. Things like The Fundamental Theorem of Arithmetic would still hold.