Hi Binoy,
A little change to the formula you have given for the calculation of gratuity:
Last drawn basic + DA * 15/26 * number of years of service
Also, to reply to Arun's query (correct me if I am wrong!):
The amount of gratuity is usually added to the CTC of an employee by an employer. This is calculated based on the basic salary of the employee, and as the basic salary increases, the gratuity amount also increases. The gratuity amount is typically set aside either in a Gratuity Trust maintained by the company, with LIC (usually done), or with a private company providing the same service.
If an employee leaves the organization before completing 5 years of tenure, they are not eligible for the gratuity amount, and the amount is retained in the fund—I don't think the amount goes to the government or the organization.
Hope this little knowledge I have shared helps you! :)
Chanchal