transformation(x) = If[x ≥ 0, floor((x - 1) / 2) + 1]
n = 1 (slider from 0 to 50, step 1)
L = Sequence((Simplify[(-1)^(k)] / Simplify[(2 * k) + 1]! * x^(Simplify[(2 * k) + 1])), k, 0, (n - 1) / 2)
m = 5 (slider from 1 to 10, step 1)
terme = Min(n, m)
lastsign = If(IsInteger[transformation(n) / 2], "", "+")
last = If(transformation(n) > transformation(terme), LaTeX[lastsign + (Element[L, floor((n + 1) / 2)])], "")
p_{t} = If(n ≥ 1, Sum[Sequence[(Simplify[(-1)^(k)] / Simplify[(2 * k) + 1]! * x^(Simplify[(2 * k) + 1])), k, 0, floor((terme - 1) / 2)]], 0)
f(x) = sin(x)
ellipsis = Text(If[transformation(n) - 1 > transformation(terme), "+-\;...", ""])
Text1: "\textcolor{#3333FF}{" + (LaTeX[f]) + "}≈" + (LaTeX[p_{t}]) + "" + (LaTeX[ellipsis]) + "" + (LaTeX[last]) + ""
p = If(n ≥ 1, Sum[Sequence[(Simplify[(-1)^(k)] / Simplify[(2 * k) + 1]! * x^(Simplify[(2 * k) + 1])), k, 0, floor((n - 1) / 2)]], 0)