(a) It can be observed that in the given matchstick pattern, the number of
matchsticks are 4, 7, 10, and 13, which is 1 more than thrice of the number of squares in the pattern.
Hence, the pattern is 3n + 1, where n is the number of squares.
(b) It can be observed that in the given matchstick pattern, the number of
matchsticks are 3, 5, 7, and 9, which is 1 more than twice of the number of triangles in the pattern.
Hence, the pattern is 2n + 1, where n is the number of triangles.