# How many palindromic postcodes are there?

The map goddess @AngharadStone posed an interesting poser on Twitter last night.

It seemed like an interesting problem, so I thought I’d give it a go.
The full definition is a fully palindromic postcode (across the space) that is also currently in use and valid.

My first thought was to start with a full list of postcodes from Doogal, and then prune them down – but my computer and excel wasn’t quite up to dealing with that many records.

Instead I wondered if I could build up to see how many possible palindromic postcodes there might be, and then see how many of them are valid.

I found a list of postcode districts on the Doogal downloads page. This is the outbound (GU1 1ED) and the first part of the inbound postcode (GU1 1ED). It struck me that there are only a very few districts which could even support a palindromic postcode:

• If the district is 5 digits long, the outbound and inbound digit have to be the same: GU1 1UG?
• If the district is 6 digits long, the first digit of the outbound, and the inbound digit have to be the same (GU10 1UG?). Also if the district is six digits long, then the space has to be ignored in the palindromicness (but that is fairly normal in well known palindromes like Madam I’m Adam).

These two criteria then allowed me to make a full list of all the possible (but not valid) postcodes.

There were 682 “five digit sector” possible postcodes, and a further 578 “six digit sector” possible postcodes. I can then construct what those postcodes would look like.

I then discovered that Doogal also has a page that can tell you how many postcodes are valid: https://www.doogal.co.uk/MultiplePostcodes.php

WOOHOO!

I can exclusively reveal there are (drum roll please)… 165 six digit valid palindromic postcodes and 167 seven digit valid palindromic postcodes – a total of 332 palindromic postcodes.

You can see the full list in this google document: