I don't know for sure.
However, -ττ- and -σσ- sometimes interchanged in Ancient Greek depending on the dialect -- for example, "sea" (θάλασσα in modern Greek) was θάλαττα in Attic Greek. (See e.g. https://en.wikipedia.org/wiki/Thalatta!_Thalatta! )
So I suppose τέσσερις had a form τέττερις in some dialects, and this may be related to the -τ- in τετρα- and τέταρτο.
It may also be related to the fact that "nine" is εννέα (two nus) while "ninth" is ένατο (one nu).
Σαράντα looks a bit similar to Russian сорок, but probably there is no etymological relationship between them: https://en.wiktionary.org/wiki/%D1%81%D0%BE%D1%80%D0%BE%D0%BA. Still this might be helpful for memorizing it.