While studying yesterday, I came across the following sentence: "バスの中で お客さんの数を 数えました" (the spaces are included in the exercise). The meaning is simple enough, but when I asked my teacher whether that "の数" is necessary for the sentence to be correct, she said yes. I still don't quite understand, however, what kind of things you could use as a direct object with "数える". What exactly can be "counted"? I've seen at least one example where the word "人数" was used. Can you use any noun that doesn't end in "数" as the direct object (that is, as the receiver of the 'を' particle) with the verb?
Edit: I was looking at examples of using this verb on the JLearn website; And I think I might understand better what is going on. Although I would appreciate very much if someone with better knowledge of the language could explain it.
On the website, there are a few examples that use the 'を' particle with the 数える verb. Most of these have as direct object either the noun '数', being further specified by a 'の' like in the example I made, or some other word that ends in that kanji, such as 人数. One used what a similar word, '量'. Most of the others, however, seem to use a different construction; counting the object inside some class. Two examples of these are:
"君は私を君の友人のうちに数えてよい" "You can number me among your friends"
"彼は世界で最も偉大な科学者の中の一人に数えられている" "He is numbered among the greatest scientists in the world"
All of these examples seem to further use an indirect object to tell us what the direct object is being counted as. As A. Ellett mentioned in the comments, this isn't really counting; but an expression that sounds similar in English.
My suspicion is that the issue with not using the word '数', or some other similar one with this verb is that doing so would imply this second construction. There is one example that doesn't fit this, however:
"彼は薄暗がりと戦いながら、彼等の名前を数えていった" "Fighting the fading light he continued to count their names"
I am not sure why this sentence in particular works; but it was the only example where I found a noun that is not a number being counted without a "に" particle to indicate what it is being counted as.