New periodic recurrences with applications