# Silly trouble expressing recursive formulas?

I am trying to code the following formulas:

I did it in the following way:

S[u_] := 2.94/(u + 520 E^(-0.14 u))
u[n_] := 1/\[CapitalSigma] Sum[X[i, x], {i, 2, n}];
X[1, n_ + 1] := S[u[n]] Sum[b[i] X[i, n], {i, 1, 13}]
X[i_ + 1, n_ + 1] := s[i] X[i, n]


But when I type X[1,5], it returns X[1,5] instead of some summation expression. This doesn't happens with u[7] tho. See:

What can be done? I tried to write X with $$n,i$$ and $$n-1,i-1$$ but it also doesn't work. Can I define it just as the formulas above?

• X[i_ +1, n_ + 1] will apply to expression like X[3 + 1, 5, + 1]. What you want is for X to apply to X[4, 6], and then properly adapt the values (minus one). Therefore: X[1, n_] := S[u[n - 1]] Sum[b[i] X[i, n - 1], {i, 1, 13}]; X[i_, n_] := s[i - 1] X[i - 1, n - 1]  Nov 14 '21 at 9:01
• However, you also have a mistake in the limits of the sum in the definition of u (should be {i, 2, 13}). Finally, there the definition for X[1, 1] is missing. Nov 14 '21 at 9:07
• If you want to retain the syntax (just for convenience), you can do With[{n = nplusone - 1}, X[i_, nplusone_] := <definition involving n>]. This will replace all ns with nplusone -1, then set the definition. Nov 14 '21 at 22:25