Ways to Express an Integer as Sum of Powers
Treat each base whose power fits as a 0/1 item and count the ways to reach n exactly, using a knapsack table.
Treat each base whose power fits as a 0/1 item and count the ways to reach n exactly, using a knapsack table.