[seqfan] Re: Rant on Maple code

peter.luschny peter.luschny at googlemail.com
Thu Aug 13 22:36:32 CEST 2009


Searching "futurevalue" results in 110 hits.

I looked at the first page in the order of display.
I did nothing else than to insert the parameters given.

A000217 with(finance): seq(add(futurevalue(k,3,2),k=0..n)/16,n=0..55);
futurevalue(k,3,2)/16 = k.

A000079 with(finance): seq(futurevalue(2,1,n), n=-1..31);
futurevalue(2,1,n)  =  2*2^n.

A000225 with(finance):seq(add(futurevalue(1,1,k),k=0..n),n=-1..31);
futurevalue(1,1,k)  =  2^k.

A002378 with(finance):seq(add(futurevalue(k,3,2),k=0..n)/8,n=0..50);
futurevalue(k,3,2)  =  16k.

A000244 with(finance):seq(futurevalue(3,2,n),n=-1..26);
futurevalue(3,2,n)  =  3*3^n.

A001906 with(combinat):with(finance):seq(fibonacci(futurevalue(n,1,1)),n=0..36);
futurevalue(n,1,1)  =  2n.

A000330 with(finance):seq(add(futurevalue(k,3,2)*effectiverate(k,1),k=0..n)/16,n=0..44);
futurevalue(k,3,2)  =  16k.

A000302 seq(futurevalue(1,3,n),n=0..24);
futurevalue(1,3,n)  =  4^n.

A001787 with(finance):seq(add(futurevalue(1,1,n),k=0..n),n=-1..28);
futurevalue(1,3,n)  =  4^n.

One more time A001787:
with(finance):seq(add(futurevalue(2,1,n),k=0..n)/2, n=-1..28);
futurevalue(2,1,n)  =  2*2^n.

A003462 seq(add(futurevalue(1,2,k),k=0..n),n=-1..25);
futurevalue(1,2,k)  =  3^k.

This was page 1. Besides the particular nice

      futurevalue(k,3,2)/16 = k

(yes Richard, I learned something, this is giant step
forward to a general method to obfuscate /any/ code)

I thus found the functions
2*2^n, 2^k, 16k, 3*3^n, 2n, 16k, 4^n, 4^n, 2*2^n, 3^k.

----
njas> Joerg suggests removing all the "with(finance)" Maple codes.
njas> I do not agree.  Some provide one-line programs
njas> for sequences that would otherwise not have a Maple program.

Number of Maple snippets on this page:

A000217  13, 9 thereof by Lajos
A000079   6, 4 thereof by Lajos
A000225   8, 6 thereof by Lajos
A002378  11, 9 thereof by Lajos
A000244   6, 4 thereof by Lajos
A001906   4, 3 thereof by Lajos
A000330  10, 5 thereof by Lajos
A000302   7, 5 thereof by Lajos
A001787   6, 4 thereof by Lajos
A003462   6, 5 thereof by Lajos

In the case that there are sequences that would otherwise
not have a Maple program this one-liner

   FV := (p,i,t) -> p*(1+i)^t;

could be used as a substitute for 'futurevalue'.

njas> In this way we may sometimes find explanations for
njas> sequences that were not known before.

This is a valid policy for the general case. However,
I think it should not be applied in the case under
consideration where this expectation is obviously false.

Cheers Peter




More information about the SeqFan mailing list