I think that math.stackexchange.com/q/4536609/42969 can be closed as a duplicate. The suggested dup target is more general (expected value of the maximum of N geometric random values instead of two), and what OP got here is consistent with an answer to the more general question.
Perhaps someone with more knowledge in probability theory than I have can also have a look at the answer to the new question. Even after a very long discussion, it looks wrong to me.
Which close reason is best for this ? - The question consists of a simple modulo-calculation , not even a power modulo some number , but a number modulo a number.