Let there be k kinds of numbers on the cards. Let a1<a2<⋯<ak be these numbers and each number is written on p1,p2,…,pk cards respectively. We will show (p1+1)(p2+1)…(pn+1)=2008, a1=1 and ai=(p1+1)(p2+1)…(pi−1+1) (1<i≤k).
Since it is able to choose some cards which sum up to 1, a1=1. Only the numbers less than or equal to p1 can be made with a1s, so if k≥2 we get a2=p1+1. Then only the numbers less than or equal to a1p1+a2p2=(p1+1)(p2+1)−1 can be made with a1s and a2s, so if k≥3 we get a3=(p1+1)(p2+1). Continuing this argument we get ai=(p1+1)(p2+1)⋯(pi−1+1) for 1<i≤k. Since a1p1+a2p2+⋯+akpk=2007, (p1+1)(p2+1)⋯(pn+1)=2007+1=2008.
On the other hand, given some positive integers p1,p2,…,pk with (p1+1)(p2+1)⋯(pn+1)=2008, letting a1=1 and ai=(p1+1)(p2+1)⋯(pi−1+1) (1<i≤k) satisfies the condition.
So all we have to do is to count (p1,p2,…,pk) which (p1+1)(p2+1)⋯(pn+1)=2008 holds. Since 2008=23×251 and 2 and 251 are primes, (p1+1)×(p2+1)×⋯×(pn+1) must be 2008,2×1004,4×502,8×251,2×2×502,2×4×251,2×2×2×251 or one of their permutations. There are 1,2,2,2,3,6,4 possible permutations respectively, so the answer is 1+2+2+2+3+6+4=20.