Nearest partition numbers

Python 2, 179 bytes

Z=range(1,99)
R=Z+[1]
for i in Z:R[i]=sum(-(-1)**k*(3*k*k-k<=i*2and R[i-k*(3*k-1)/2])for k in range(-i,i+1)if k)
f=lambda n:zip(*sorted((abs(n-R[i]),i)for i in Z))[1][:2-(n in R)]

Uses the recursive formula from Euler's pentagonal theorem.

Call with f(2484). Output is a tuple with one or two numbers.


Pyth, 53

L?!b<b1sm&d*^_1tdy-b/*dt*3d2r_bhbJo^-QyN2U99<J-2qQyhJ

Explanation and more golfing to follow.


Mathematica, 124 123 bytes

f@n_:=(p=SeriesCoefficient[1/Product[1-x^k,{k,#}],{x,0,#}]&;s=SortBy[Range@95,Abs[n-p@#]&];If[p@s[[1]]==n,s[[1]],s~Take~2])

Formula for partition numbers taken from the OEIS page. (May or may not be cheating... I couldn't decide.)

Usage:

In: f[136]

Out: {14, 13}

I'm not answering to win. And I'm sure this could be golfed further.