[seqfan] Re: Re Nice variant on A030067

Russell Walsmith ixitol at gmail.com
Sun Jan 12 19:22:37 CET 2014


Okay, I see what happened... I already had an f := proc(n) on the page when
I pasted the code, so I changed the name to g := proc(n). Problem was, I
forgot to apply the changes to the internal 'f's... I guess it's a wonder
that it ran at all!
Oh well, at least this oversight initiated an informative discussion...
still, this is perhaps a sign that I should spend more time with fractals,
where my siliest mistakes sometimes produce the most amazing images...
Regards, Russell


On Sun, Jan 12, 2014 at 9:53 AM, jean-paul allouche <
allouche at math.jussieu.fr> wrote:

> Mathematica or Sage? Any hint?
> (I know the classical "vi" vs "emacs" and the like :-))
> jean-paul
>
>
> Le 12/01/14 18:46, Neil Sloane a écrit :
>
>  Maximilian, That is very helpful, thanks - I replaced the Maple code.
>> Maple has done this repeatedly over the years - changing fundamental
>> commands
>> so that old programs no longer work. Guess it is time to
>> switch to Mathematica.
>>
>>
>> On Sun, Jan 12, 2014 at 11:48 AM, M. F. Hasler <oeis at hasler.fr> wrote:
>>
>>  If I may:
>>>
>>> The RETURN() or return() or RETURN or return functions/statements are
>>> useless and error-producing since the syntax changes in each version of
>>> Maple. (I exaggerate, of course.) But its true that they are useless
>>> (unless you really have to "bail out" from inside a multiply nested loop
>>> or
>>> similar construct) and it's not only simpler, shorter, but plain better
>>> to
>>> just remove them, so it should read:
>>>
>>>    f:=proc(n) option remember; local t1;
>>>
>>>>    if n = 1 then 1
>>>>    elif n mod 2 = 0 then f(n/2)
>>>>    else t1:= f(n-2)-f((n-1)/2);
>>>>    if t1 > 0 then t1 else f(n-2)+f((n-1)/2) fi fi end;
>>>>
>>>
>>> (unless I'm wrong)
>>> See also http://www.maplesoft.com/support/help/Maple/view.aspx?
>>> path=return:
>>>
>>>>>>
>>> One common form of return from a procedure invocation occurs when
>>> execution
>>> ``falls through'' the end of the statement sequence which makes up the
>>> procedure body, in which case the value of the procedure invocation is
>>> the
>>> value of the last statement executed.
>>>>>>
>>> The return statement supersedes the RETURN function, which still exists
>>> for
>>> backward compatibility. However, use of the RETURN procedure is strongly
>>> discouraged.
>>>
>>>
>>> Maximilian
>>>
>>> _______________________________________________
>>>
>>> Seqfan Mailing list - http://list.seqfan.eu/
>>>
>>>
>>
>>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list