The definition is recursive, f[30]
evaluates here (Mathematica 10.1, Window 7 64 Bit Home Premium) without messages, but in general a big enough argument invokes the reclim message, if the $RecursionLimit
is not set to Infinity
(then RAM tends to become short)
In[1]:= (* comm490447 *)
Clear[f];
f[0] = 1000000;
f[x_Integer /; x > 0] := f[x] = f[x - 1]*1.05 - 41000
In[4]:= f /@ Table[o + 10^o, {o, 0, 8}]
During evaluation of In[4]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of 8983>0. >>
During evaluation of In[4]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of f[8983]. >>
Out[4]= {1.009*10^6, 1.12786*10^6, 2.69164*10^7, 3.2221*10^26, Hold[f[8983]], f[100005], f[1000006], f[10000007], f[100000008]}
(* this quits the kernel because of RAM exhaustion *)
Block[{$RecursionLimit = 10^8 + 9}, f /@ Table[o + 10^o, {o, 0, 8}]]
In[5]:= Block[{$RecursionLimit = 10^4 + 5}, f /@ Table[o + 10^o, {o, 0, 4}]]
Out[5]= {1.009*10^6, 1.12786*10^6, 2.69164*10^7, 3.2221*10^26, 1.7101*10^217}
In[6]:= $RecursionLimit
Out[6]= 1024