> Numbers behave in a quite complicated fashion. wāḥid- "one" and ithnān- "two" are adjectives, following the noun and agreeing with it. thalāthat- "three" through ‘asharat- "ten" require a following noun in the genitive plural, but disagree with the noun in gender, while taking the case required by the surrounding syntax. aḥada ‘asharah "eleven" through tis‘ata ‘asharah "nineteen" require a following noun in the accusative singular, agree with the noun in gender, and are invariable for case, except for ithnā ‘asharah/ithnay ‘ashara "twelve".
Note that this is just the introduction and doesn't purport to set out all of the rules... (!)
https://en.wikipedia.org/wiki/Arabic_grammar#Numerals
> Numbers behave in a quite complicated fashion. wāḥid- "one" and ithnān- "two" are adjectives, following the noun and agreeing with it. thalāthat- "three" through ‘asharat- "ten" require a following noun in the genitive plural, but disagree with the noun in gender, while taking the case required by the surrounding syntax. aḥada ‘asharah "eleven" through tis‘ata ‘asharah "nineteen" require a following noun in the accusative singular, agree with the noun in gender, and are invariable for case, except for ithnā ‘asharah/ithnay ‘ashara "twelve".
Note that this is just the introduction and doesn't purport to set out all of the rules... (!)