It was just a joke, and doubly so the fact it "works" in base 13.
It was written as a joke in fairly ramshackle radio play. He had no idea at the time of writing it that the joke would connect so well and become it's own "thing" and dominate discourse of the radio series and novels to come.
It's not a joke about numbers, it's a linguistical joke, that works well on radio, something that HHGTG is stuffed full of.
That's not the question, though.
Everybody knows that the question is the one posed to Mister Turtle and Mister Owl which neither of them can find the answer to.
https://en.wikipedia.org/wiki/42_(number)