I have always used this set of mappings to interpret the escape sequences as numbers when $TERM=xterm
imap Oq 1
imap Or 2
imap Os 3
imap Ot 4
imap Ou 5
imap Ov 6
imap Ow 7
imap Ox 8
imap Oy 9
imap Op 0
imap On .
imap OR *
imap OQ /
imap Ol +
imap OS -
I think this was my original source.