Counting Abelian groups of a given size
CJam, 50 49 47 43 bytes

ri_mF{1=_L{1$0&gt;{,f{):X-Xj}:+}{;!}?}2j}%:*e&amp;


Uses CJam's builtin mF factorisation and a memoised port of this Python partition number function:

p=lambda n,x:n==0 or n&gt;0and sum(p(n+~a,a+1)for a in range(x))


or ungolfed:

def p(n, x): # Call like p(n, n). n is number remaining, x is max part size
  if n &gt; 0:
    return sum(p(n-a-1,a+1)for a in range(x))
  else:
    return (n==0)


Like @RetoKoradi's answer, the last case takes about 17 seconds on the offline interpreter because that's how long it takes CJam to factorise the number. Hence I've left it out of this online test suite.

Full explanation

[Main body]
ri                                Read input and convert to int
  _          e&amp;                   Logical AND input with final result to special case 0 
   mF                             Factorise input into [base, exponent] pairs
     {...}%                       Map, converting each pair to a partition number
           :*                     Take product

[Pair -&gt; partition]
1=_                               Get exponent and copy (n,x in above Python)
   L                              Initialise empty cache
    {                       }2j   Memoise with 2 arguments
     1$0&gt;                         Check if n &gt; 0
         {            }{  }?      Execute first block if yes, else second block
                        ;!        Return (n == 0)
          ,f{      }              For each a in range(x) ...
             ):X-Xj               Call p(n-a-1,a+1) recursively
                    :+            Sum the results