From Old English 'maenan' (to have in mind), from PIE *men- (to think) — to mean is literally to have in mind.
To intend to convey or refer to a particular thing; to have as a purpose or intention.
From Old English 'mǣnan' (to mean, to intend, to signify, to tell of, to complain about), from Proto-Germanic *mainijaną (to have in mind, to think, to opine), from PIE *meino- (opinion, intention), a derivative of *men- (to think). The PIE root *men- is one of the most prolific in the family: it produced Latin 'mens' (mind), 'mentālis' (of the mind — whence 'mental'), 'meminī' (I remember — whence 'memory'), 'commentārī' (to ponder — whence 'comment'), Greek 'ménos' (spirit, force, ardour), 'manía' (madness — whence 'mania'), 'mantis' (seer, prophet — one whose mind is inspired), Sanskrit 'manas' (mind), and English 'mind' itself via Proto-Germanic. The verb 'mean' is thus a sibling
English has three completely unrelated words spelled 'mean': the verb (to intend, from OE 'mǣnan' / PIE *men- 'to think'), the adjective meaning 'unkind' (from OE 'gemǣne,' common, shared — related to Latin 'communis'), and the mathematical noun (from Old French 'meien,' from Latin 'medianus,' middle). Three different roots, three different language families, one spelling.