Possible Duplicate:
Mathematica: How to clear the cache for a symbol, i.e. Unset pattern-free DownValues
This link shows a way to speed up recursive definitions in Mathematica.
f[0]=f[1]=1
f[x_] := f[x] = f[x - 1] + f[x - 2]
Now suppose I find f[5] from this definition. Then the following values are stored in memory
?f
Global`f
f[0]=1
f[1]=1
f[2]=2
f[3]=3
f[4]=5
f[5]=8
f[x_]:=f[x]=f[x-1]+f[x-2]
Suppose now that for some later computation I want to remove the cached values of f from memory but not the definition of f. How can this be done neatly.
I have Tried Unset[f[n_]], but this removes the definition and not the cached values. I have tried Clear["_Integer"] but this does nothing.
Does anyone know how to remove the cached values f[2],...,f[5] but not the definition of f? Without writing some type of loop involving Unset[f[k]] Because I dont know the value of k in advance. Thanks for reading