I want to try to understand recursive functions in J. To start this
learning process, I want to investigate J verbs that will generate a
doubling sequence. For example, the verb 'd' where x = the starting
integer, and y = the number of iterations:

   2 d 6
2 4 8 16 32 64

   5 d 4
5 10 20 40

   7 d 10
7 14 28 56 112 224 448 896 1792 3584

Define three different simple recursive verbs in J, to implement this
recursive doubling function:
1. d1 - Just calling the function recursively
2. d2 - Using the Power operator ^:
3. d3 - Using Spread S: and Memo M.

Skip

Skip Cave
Cave Consulting LLC
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to