Iterated log, usually written as log*(n), is defined piecewise as:

                 +---------------------
                / 0             if n<:1
        log*(n)=
                \ 1+log*(log n) if n> 1
                 +---------------------

This can be expressed directly in J using agenda (@.):

        logstar =: 0:`(1+$:@^.)@.(1<:])"0

But this feels fairly "procedural". All the work is in the recursion. Is
there a more elegant way to express it?

-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to