1-2-1-3 is the same as 1-2 AND 1-3 : the route will already exist from the basic pairs derived from your 21 destinations : if port A and B are already connected by a previous route, then it dont matter where the ship came from to reach A or where it went after B : its the pre-existing route between them that disqualifies any other combination that includes them.
I'm not saying that is logically correct : but according to the conditions given by Captain D, no other outcome is logically possible.
Your calculation is based on : how many 2 unique port combinations are there : PLUS : how many unique 3 port combinations are there : PLUS : how many unique 4 port combinations are there : DISREGARDING : reverse routes or repeated sections of routes.
But that is not the stated conditions of the OP.