Answer: About 19,684 years
====================================================
Step-by-step explanation:
A penny is about 1.52 mm thick.
This converts to (1.52)/1000 = 0.00152 meters
The distance from earth to the sun is about 149,597,870,000 meters. This is the average distance and it fluctuates over time (since both the earth and sun are constantly moving). For the sake of simplicity, we'll assume the distance is constant.
Divide that distance over the thickness of a penny to find out how many pennies we'll need
(149,597,870,000)/(0.00152) = 98,419,651,315,789.40
This rounds up to 98,419,651,315,790
So we need a little over 98.4 trillion coins.
We divide that massive number over 5 billion (aka 5,000,000,000) to find the number of years.
So,
(98,419,651,315,790)/(5,000,000,000) = 19,683.930263158
Round up to the nearest full year and you should get 19,684
It will take approximately 19,684 years to make enough coins to stack and reach the distance needed. This is assuming the rate of 5 billion pennies per year is kept constant.
--------------
Side note:
If you want, you can use scientific notation to shorten the massive numbers.
For example, 5 billion = 5 * 10^9
Another example: 98.4 trillion = 9.84 * 10^13