From a previous undeclinable Eastern Baltic *dewin-, from Proto-Balto-Slavic *newin-, from Proto-Indo-European *h₁néwn̥, *néwn̥ (“nine”). Probably from the same stem as *néwos- (“new”); apparently Proto-Indo-European had a base 4 numeric system, so that, after two 4's (= 8), 9 was the first (“new”) to be part of a complex numeral (compare Ossetian фараст (farast, “nine”) = фар (far, “over”) + аст (ast, “eight”)).
The initial d in Eastern Baltic and Slavic is usually explained as dissimilation, given the two n's in *newin-, probably also under the influence of the initial d in desmit. A more recent suggestion is that Proto-Indo-European *néwn̥ < *h₁néwn̥, in which the h₁n sequence would yield an articulation similar to a d. This would have led to dialectal variation (*néwn, *déwn), with both forms preserved in parallel, the former giving rise to the Eastern Baltic terms, the latter to their Old Prussian counterpart. Cognates include Latvian deviņi, Old Prussian newints (“ninth”), Old Church Slavonic девѧть (devętĭ), Russian, Ukrainian де́вять (dévjatʹ), Belarusian дзе́вяць (dzjévjacʹ), Bulgarian де́вет (dévet), Czech devět, Polish dziewięć, Gothic, Old High German 𐌽𐌹𐌿𐌽 (niun), German neun, English nine, Sanskrit नवन् (návan), Ancient Greek ἐννέα (ennéa) (< *en néwa), Latin novem, Tocharian A, Tocharian B ñu.
devyni m (feminine devynios)