If you accept the sort-function (which brings an array of numbers in ordered form) as a mathematical expression, then the solution is obvious: sort to decreasing order, eliminate doubly occuring items, take the first two items. Of course there are much more efficient ways to program this selection. That a traditionally educated mathematician will probably not accept such a program code as 'a mathematical expression' has only historical reasons. Actually all constructs of imperative programming languages are mathematical expressions.