use lookup table for tiny p(n), and add test code