Ramanujan's greatest contribution to mathematics is his work on the theory of partitions and his discoveries related to modular forms and mock theta functions. These contributions have had a profound impact on various branches of mathematics .