Assignment query

Need assistance for below queries:

1)write a program for recursicve function to calculate the sum of numbers from 1-10.
2)How to genrate ramdom captcha and to shuffle them ?