From the Kanja Otogi Zoshi (“Collection of Interesting Results”) of Nakane Genjun, 1743:
Your friend has 30 go stones. He lines them up out of your sight, placing down either one or two stones with each deposit and calling “here” so you’ll know this has been done. When all 30 stones have been placed, you have heard him say “here” 18 times. How many deposits contained one stone, and how many two?