Anders Hellström on Wed, 22 Mar 2023 02:28:50 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: defining a recurrence
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: defining a recurrence
- From: Anders Hellström <anders.hellstrom@mailfence.com>
- Date: Wed, 22 Mar 2023 02:27:31 +0100
- Cc: jl.arnaud@free.fr
- Delivery-date: Wed, 22 Mar 2023 02:28:50 +0100
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1679448457; s=20210208-e7xh; d=mailfence.com; i=anders.hellstrom@mailfence.com; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; l=538; bh=E4rWIj7OpZCXd3ZCeq1nEfCby2n3D4/VjfEV7J1Qpow=; b=nHNUKBm2ldbz7oSwVoLgKuC8xiJZ5L7SK5XH8hJtSllLxB3dqRQ6vyF8ZsHegD/W AnDfbTtJhF21DC8yMxiyXlzu1M//7Btm8IfjeJ17OhH6/KfMOz9rcqEEA1jZq5UBzgI rBv/yO24nawLJrNwIMs2hcarVgk9qMMAqiInFYvn9QwpTetMqb2BleGC9GeZC7WUd6a PnsHxEokuA1xgqV1ZEW5QIM84NEZDo0emNEq8gqrUOpP9gdIrnAaqDfmDMQk6XRH3uW nghvypgZ9euDtNrShUcQXSYsOOyZe3tNZKgHFmBkECNNYO8JXqEISczqojKOluWPZgM pTUJ+99WCA==
- In-reply-to: <1c5a1608-bb92-5097-b963-bf047c361de8@free.fr>
- References: <1c5a1608-bb92-5097-b963-bf047c361de8@free.fr>
Factorial with or without recurrence.
fact1(n)=my(m);if(n==1,m=1,m=n*fact1(n-1));m %%recurrence
fact2(n)=prod(k=1,n,k) %%Product
//Anders Hellström
On Wed, 22 Mar 2023 02:01:52 +0100
Jean-Luc ARNAUD <jl.arnaud@free.fr> wrote:
> Hi all,
>
> Looking in PariGP documentation, I don't find how to define a
> recurrence.
>
> For example, let say I'd like to define the Factorial function F:
>
> F(x+1)=F(x)*(x+1)
>
> F(1)=1
>
> How to define F, if possible?
>
> TIA
>