Can I somehow create a list and its cumulative sum at the same time, e.g. with Table
: Now I do it in two steps
marsYr = 686.9726;
marsYrInt = 687;
startId = {520, 585};
mYrLen = Table[
If[(Floor[(marsYrInt - marsYr)*(i)] -
Floor[(marsYrInt - marsYr)*(i - 1)] == 1) ∧ (i > 0),
marsYrInt - 1, marsYrInt], {i, 0, 80, 1}]
Accumulate@mYrLen
Then I would need to join the two lists, but can this be done within one "step", eg. within the table?
Also, would it be possible to use this Accumulate
within the Table
to control the upper bound of the generated table - i.e. continue with the table while the accumulate of current i is smaller than a certain value.