why is this better than the easy to read version that Roger Hui sent?
quote:
+/\4+i.10
4 9 15 22 30 39 49 60 72 85
unquote: This is also the way APL does it Sure it is fun to try
different ways such as below, just as it is fun to make a 1 liner to
generate a series for sin x. It is also nice to come back to a piece of
code written a year earlier and be able to recognize quickly what it
did. In the end- the simpler expression uses the power of J to do it
more neatly and faster Don Kelly
On 2017-09-28 1:02 PM, Xiao-Yong Jin wrote:
On Sep 28, 2017, at 2:45 PM, Erling Hellenäs <[email protected]> wrote:
4 [`(] (] , [ + [: {: ]) [ $: [: <: ])@.(<) 8
4 9 15 22 30
Super!
4 [`(] (] , (+{:)) ($:<:) )@.< 8
/Erling
On 2017-09-28 20:33, Skip Cave wrote:
What is a good way to generate this sequence in J?
4,(4+5),(4+5+6),(4+5+6+7),(4+5+6+7+8)+.....
Show one way using i. and insert.
Show another way using recursion.
Skip
Skip Cave
Cave Consulting LLC
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm