Err, have you ever done any serious computer programming using very large databases ?. What you are describing is anything but simple because of the number of bonds still in circulation, the number being added every month, and the number being encashed leaving gaps.
Even if you managed to load all the active bond numbers and their bond holder numbers into memory, and then sorted them, the amount of disk activity and processing power would be almost impossible, the number of active premium bond numbers is into the billions, I think.
<snip>