The code for my program is as follows:
Clear[f];
{$RecursionLimit = Infinity};
f[n_] := If[n >= 1, f[n] = n - 1 + (-1)^n 2 f[n - 1], f[n] = 0];
FullSimplify[f[2020]/2]
I am using Mathematica 12.0, and trying to find f[2020]/2, but when I run the program I get an un-simplified result, the same using the Simplify, FullSimplify, and no function at all.
4815609167711586848007869227032356256312743227141422634144178841639258733223064376890242310095267513944017583269163671060520344846023756428821109590895218122099470699921398772560089491365798131644138341901312406104325088656339013004576875915896321903255827106838867819739516957333842785448961317408670542466925730316291502478820826826477731689044263368148553678106934675474617807970711635671594529280688929069927871781358399593472235076472408459246709587161732797507513416515412957925372883934815425197732231405475243618346154282741695439549613768814420303038299401914064527250128757745765469699137785079955/2
How can I get the result simplified without the "/2"?
To further clarify what I mean by simplify, I mean that the above number would turn into an exact decimal, but not go into scientific form.
Ex: Long number .5 instead of (the original number)/2
N. – MarcoB Feb 04 '20 at 18:47First[RecurrenceTable[{f[n] == n - 1 + (-1)^n 2 f[n - 1], f[0] == 0}, f, {n, 2020, 2020}]].) – J. M.'s missing motivation Feb 04 '20 at 18:47N[f[2020]/2]to see a decimal; otherwise, you have it backwards, since in Mathematica, fractions are exact, while decimals are inexact numbers. – J. M.'s missing motivation Feb 04 '20 at 19:08Nis for. TryN[f[2020] / 2]for machine-precision results. If you want, you can also specify higher precision with a second argument toN, such asN[f[2020] / 2, 620]. – MarcoB Feb 04 '20 at 19:08