Question 5 Solve Via Recursive Function Using Prolog

Question 5 Solve Via Recursive Function Using Prolog