Grep command in "Text.txt" that contain a character “a” not followed by a character “i” and end with any numeric character.

grep -E "a(?!i).*[0-9]$" Text.txt