Writing routine for counting prime pairs.