I am reading about loop invariants and I don’t understand one thing:
For algorithm
r = c
while r > 0:
r = 31 * r % 73
Is r < 73 loop invariant?
Answer in the book says yes, but from what I understand loop invariant needs to be true before program enters the loop.
And we can set r to 74 for example so before the loop invariant isn’t true only inside and after the loop it will stay true.