By under the circumstances, I mean the guy is looking through a pile of used heads not marked with any official part numbers. So he is looking for some identifying feature (casting number). If you were going to a new parts store, they would look for the official part number as listed in the parts book, not a casting number. The casting number is for the part as it came from the mold. Once additional operations were performed on that raw casting, the number changes. In some cases, a particular casting may be machined into more than one finished product.
Yes, that buggered up 6 digit number is the casting number. And it is what the guy is looking for to pick one out of his pile of unidentified used parts.