ثَلَاثَةٌ and ثُلَاثُ have the same grammatical function whenever both refer to 3.

Cause of Ghayr Munsarif: Transformation (Adl)