patterns and sequences calculator