Ramanujan's writing for near misses