Skip to main content

Challenge 123: Problematic Postcodes

Can you find how many of the 100000 possible 5 digit ZIP codes are usable

In the USA, addresses include ZIP codes instead of our postcodes to help send post to the right place. Each area/town has a five digit code assigned to it; so for example if you wanted to visit the White House, you might key in its ZIP code (37188) into your GPS for directions.

However, due to rotational symmetry certain codes are problematic, as they could be read as a different code upside down. For example, 06061 is the ZIP code for the idyllic sounding Pine Meadow in Connecticut. If you read this upside down, you get 19090, which is the ZIP code for the equally scenic Willow Grove in Pennsylvania.

If the US Postal Service wants to eliminate all possible confusion due to these zip codes, how many of the 100000 possible 5 digit ZIP codes can they use?