First published in 1730. The math riddle has a similar version in existence in a papyrus purchased by Scottish Antiquarian Alexander Rhind in Luxor, Egypt, in 1858. The problem is list as No. 79. That papyrus has been dated to around 1650 BC.
Dr. Thripshaw: "Come in." Burrows: "Can I down sit?" Dr. Thripshaw: "Certainly. (Burrows sits) Well, then?" Burrows: "Well, now, not going to bush the doctor about the beat too long. I'm going to come to point the straight immediately."