This trick is described in a 1630 miscellany by Thomas Johnson, A New Booke of Dainty Conceits, np. Philippe Billot, who discovered this entry, provides the following transcription:
“I put the case that I deliver to my friend standing by, the six of Clubs, and I take the two next Cards, which are the Queen of Hearts and the four of Diamonds, I say therefore unto my friend, or lay a wager with him, that I have as many as he, as many as will make him ten, and four pips to spare, and so is there.
“In like manner I deliver to a stander by two Cards, and take myself double the number, to wit four: I may say in like sort, that I have as many as he, and as many as will make him twenty, and so many to spare as I have pips in my hand above twenty.
“So likewise delivering three Cards and taking sixe to yourself, you may say that you have as many as he, and as many as will make him thirty, and the odd pips to spare: and thus you may do it to many Cards, in doubling the Cards, and respecting ten so every Card.”
This trick is almost certainly much older than Johnson's book, being typical of the sort of mathematical mentalism that constitutes some of the earliest recorded conjuring secrets.
The trick has been unearthed and variations presented a number of times in modern conjuring literature. Here are a few examples: Howard L. Grant's “A Novel Card Effect” in The Magic World, Vol. 4 No. 8, Nov. 1920, p. 107. Grant introduces the trick by writing, “While it is by no means new, it has never appeared in print…” His first statement is correct. (Thanks to David Britland for this citation.)
“Toothpick Magic” by U. F. Grant appeared in The Sphinx, Vol. 25 No. 12, Feb. 1927, p. 357. The following year, the principle was reapplied to playing cards in “Counting Trick” in Rufus Steele's Card Tricks You Will Do, 1928, p. 14. The version Steele describes eliminates one of the three claims made to the spectator, and thereby leaves the method more bare. There is a similar entry in Page Wright's Notebook, 1933, p. 2, but with the third statement reinstated. This book was published three years after Wright's death. Wright says of the piece, “The Number Discovery card trick, as shown to me by Larsen.” This entry may have been made by Wright before Steele's booklet appeared, which would explain why William Larsen is mentioned rather than Steele.
“A Teaser” by Eric F. Impey, using matches instead of toothpicks or cards, appeared in Edward Bagshawe's Magical Journal, Vol. 5 No. 3, Dec. 1931, p. 71; then Paul Stadleman's “So Simple” in Sandu Writes Again, 1934, p. 4. In Greater Magic, 1938, p. 157, John Northern Hilliard confirms Howard L. Grant's statement about the age of the trick, writing that the principle is “ancient”, and one he learned as a boy. He goes on to describe a two-phase version of the trick, the second part of which he claims as a new twist of unknown origin. Both phases are very similar to those given by Stadelman, the second being credited by him to R. W. Hull.
For more historical information on this trick, and Al Koran's involvement with it, see David Britland's “Cardopolis” column in Genii, Vol. 77 No. 6, June 2014, p. 24.