ex4.4 - sequence using pattern matching