Not certain about Polish any more (it’s 15 years or so since I studied) but certainly Russian uses the genitive singular after numbers ending in 2, 3, and 4 (e.g. 02, 23, 34, but not the “teens”) and genitive plural for numbers ending in 5, 6, 7, 8, 9, 0). The endings here look the same.
Does Polish also use the same form for 20 as for 0 (i.e. 20 książek)? As I remember it does. If I remember correctly, Polish also differs from Russian in that it only uses the singular for 1, not for all numbers ending in 1 (except 11).
(Note for linguists, it’s not actually quite the genitive, but it’s close enough not to warrant its own case)