Ordinary di ff erential and di ff erence equations invariant under SL ( 2 , R ) and their solutions