Your math is flawed, the positition has to repete 3 time. No math is needed.
You are wrong, it's not 3 times, but it is 22! Maybe a better way to word the question is, "What is the highest possible number of occurrences of a position without 3-fold repetition applying?", in which case that would be 21. A position can occur 21 times with no 3-fold repetition, but by the 22nd time, there is no way that 3-fold repetition has not occurred.
It must be the same position, with the same player to move, both players having the same legal options.
Let's say, hypothetically, that it is White to move. White has a pawn on d5, and that pawn is NOT pinned to the King, and Black's last move was c7-c5. Both sides have not moved their kings. Both sides have not moved their Rooks (either one of them). Both sides have no pieces between the King and either Rook, and both sides can legally castle in either direction, meaning neither side is in check, and White is not controlling c8, d8, f8, or g8, and Black is not controlling c1, d1, f1, or g1. Therefore, you have a position like the following:
FIDE rules specifically talk about 3 fold repetition. If you think one can repeat the position 4 , 5 or 50 times without activating the rule then show us a concrete example. That is the only way to get a concrete answer.
Why is it so hard to get the actual point of the question?
Let me pose it in another way: Assume the same arrangement of pieces has appeared during the game two times. Can you claim draw by 3-fold repetition? No.
But if the same arrangement of pieces appears during the game three times, can you then claim draw by 3-fold repetition? Yes.
Except not always. Even though the arrangement of pieces may be the same, the position is not always considered having repeated. Among other things, castling rights are considered when evaluating whether the position is the same as a previous one (iow. even though the pieces may be on the same squares as before, if in that previous instance you had a castling right that you don't have now, it will be considered a different position).
So my question is: What is the theoretical maximum number of appearances of the same arrangement of pieces that could happen before you could claim draw by 3-fold repetition (taking into account all those extra requirement posed by the 3-fold repetition rule)?
Why is this so hard to understand? Responding with "claiming draw by 3-fold repetition is optional" is completely and absolutely missing the point of the question.
Heck, playing the game is optional. That still doesn't isn't a valid answer to the question. I'm not asking whether claiming the draw is optional or not. That has absolutely nothing to do with the question.