what is max distance between posts using 2x12x20 foot beams for a pergola
You can easily span 12' with a 2x12 for a pergola as long as your load is not crazy. What is going on top of the 2x12's? 2x2's? I would set my posts on 12' centers and cantilever 4' on each side. I would also sandwich a 2x12 on each side of the post. There actually is enough information in your question but  there are many online beam span charts. Here is one. Hope it helps. Make sure there is no earth to wood contact on your posts and you will enjoy your pergola for decades.
http://www.decks.com/deckbuilding/beam_span_chart_table