There are coins that are trying to do that. Primecoin for example is looking for prime numbers.
In any case mining is essential for bitcoin to work so you can't really call it a waste.
It can't be secure because all such work is preimageable because it has to be known to someone a priori. The Bitcoin proof-of-work can't be known a priori.