The formula is: gems = sims ^ .4 * 20
I did about 1.6 M sims and eventually got over 6000 gems. It is known that the volume trick does not work now. Instead, try completing a new level. See how these work for you: https://codecombat.com/play/hoc-2018