You could write T
as c+2
, but your table is too long, i.e.
z = Table[c, {c, 3, 54, 2}]
{3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53}
z + 2
{5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55}
So again, if you wrote T
as c+2
, (and minimum i
as c-2
) . . .
Table[Sum[(y[[i]]*((i - c)/h)*((i - c)/h)), {i, c - 2, c + 2}]/
Sum[((i - c)/h)*((i - c)/h), {i, c - 2, c + 2}], {c, 3, 54, 2}]
. . . you would need y
to represent a list of 55 numbers, not 54.
For example, this works ok :-
y = Array[RandomInteger[10] &, 55];
Table[Sum[(y[[i]]*((i - c)/h)*((i - c)/h)), {i, c - 2, c + 2}]/
Sum[((i - c)/h)*((i - c)/h), {i, c - 2, c + 2}], {c, 3, 54, 2}]