Dear friends,
I have the following code; I appreciate if someone helps me what is wrong with it?
KK = 3;
limm = 4;
yall = {};
For[j = 0, j <= limm, j = j + 1, pt = j;
px = 2^pt;
outloop = 0;
For[i = 1, i <= KK, i = i + 1, ntest = i;
Which[ntest == 1,
y1 = px + 1,
ntest == 2,
y1 = px + 2,
ntest == 3,
y1 = px + 3]
outloop = outloop + y1;
]
y2 = N[(outloop)];
yall = Append[yall, outloop];
]