For 0<=t<=10, if 5t<=n<=5t+2, then f[n]=4n, and if 5t+3<=n<=5t+4, then f[n]=4n+1?
I would like then to use the specific values of f[n], for all n between 0 and 54 (t here is any integer between 0 and 10).
I tried:
f[n_] := Piecewise[{{4 t, 5 t <= n <= 5 t + 2},
{4 t + 1, 5 t + 3 <= n <= 5 t + 4}}]
I tried f[5] (after Clear[t]). I got: f[5] is 4t if 5t<=5<=5t+2 and 4t+1 if 5t+3<=5<5t+4.
I would have liked to simply get 4.
t
was assigned a value. Can you give a complete example, including all relevant definitions? Do you have a definition fort
? This site gives good guidelines on how to ask a question: sscce.org $\endgroup$