Bill Allombert on Tue, 28 Jan 2020 14:51:19 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Not a function in function call


On Tue, Jan 28, 2020 at 11:31:52AM +0000, Predrag Terzic wrote:
> But, this one doesn't :
> 
> n=22;
> prevprime(k)={p=1;while(p<k,r=p;p=nextprime(p+1));return(r);}
> compositorial(n)={c=10;l=[];forcomposite(i=1,n,c=c*i;l=concat(l,[c-prevprime(c-1)]));return(l);}

Why not use the GP function precprime instead of prevprime ?

> How to fix this problem?

I assume prevprime take too much time.

Cheers,
Bill