Some items come in quantities in 20. They USUALLY double, but it's possible some items might be exempted from the doubling effect. For example, if an NPC buys certain items, but doesn't sell them, it won't restock them. Some of the NPCs (especially in those two locations) aren't necessarily standard NPCs as well (different profession titles), and might not have been programmed to work exactly like the mage NPCs.
If a NPC vendor times out and is replaced by another NPC of the same profession (but a different name), the replacement NPC will be back to base amounts for the items sold in 20s (but appears to retain the prices for the 500-count items). Vendor resets are relatively rare, but sitting at Luna bank you'll occasionally see a tailor or blacksmith blink out, then a replacement appear.
Some items come in quantities of 500. They do not double, and go up in price every 1000 sold.
Note that the timer for the restock is different for each vendor (both in time between restocks, and when it occurs), and if a restock time passes while the amount is increased, the stock is reduced. So, if a vendor is bought out, it might go to 40, but if it attempts to restock while at 40, it drops back to 20, or to a number between 20 and 40 (then to 20 on the next restock).
There's been times where I've seen a vendor restock WHILE I'm buying from it. so that the things I was buying were not affected, but things I already bought were (typically, buying stuff to fill BODs) - slowing down my buying process or canceling the purchase because the number of items in stock was not the same when I clicked OK as it was when I opened the purchase menu.