
To obtain and then upgrade 36 5-star legendary gems to rank 10, you need 74*36 = 2664 legendary gems. That makes 6 gems in total, and with 6 gear slots to awaken you need 36 rank 10 5/5 star legendary gems. You seem to be able to slot 5 extra gems into an awakened item. From the chart given, it works out to take 73 duplicates of the same gem to upgrade to rank 10, so you need 74 in total (by the time you get 73 duplicates you will have so many spare 1 and 2-stars that gem power doesn't matter).

The website breaks down how to rank up legendary gems. To start with, based on others calculations it can take anywhere between $2450 to $25530 USD for a single Rank 1 5-star legendary gem - for now lets take the average of this -> $13990
