I want to generate the series {1930, 1934, 1938, ..., 2014}
with Mathematica. I found that I can use Sum[2014-m*4, {m, 20}]
to get the sum of these numbers, so I tried Array[2014-m*4, {m, 20}]
, but no luck. How do I do this?
Take the 2-minute tour
×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
closed as off-topic by Simon Woods, kale, m_goldberg, gpap, Sjoerd C. de Vries Apr 11 at 13:22This question appears to be off-topic. The users who voted to close gave this specific reason:
|
|
show 1 more comment |
There are several way to do this as noted in the comments:
|
||||
|
Range[1930, 2014, 4]
and thenTotal@Range[1930, 2014, 4]
? – Öskå Apr 11 at 11:38Array
does not take an iteration variable. Use it likeArray[1926 + 4 # &, 22]
or alternatively useTable[1926 + 4 m, {m, 22}]
– Simon Woods Apr 11 at 11:46Array
:) – Öskå Apr 11 at 11:59