someone asked in an earlier question where the prohobition of counting jews comes from and the rabbi answered that it came from a gemora in yoma reffering to hoshea. I thought that the prohobition came from the fact that dovid hamelech counted 7,000 people from the tribe of dan and then 7,000 people from the tribe of dan died. Am I right or wrong?
The Gemara (Yoma 22b) finds a Biblical allusion to the prohibition against counting Jews per head in Hosea. It is clear from the Gemara itself that Hosea did not enact the prohibition but that the verse hints at a prohibition existing from the time of Moses. The Gemara (Berachot 62b) refers to an obligation to contribute a head-tax to the Temple when performing a census of the Jewish population. The source for this is Shemot 30, 12. The Gemara mentions that King David was punished (Divrei HaYamim I 21) for ignoring this in counting the Jews from Dan to Beersheba. The Ramban (Bamidbar1 2) believes that David was punished even though the head tax was collected and the number of Jews was calculated according to the sum raised, because the census was unnecessary.