Loïc Grenié on Sat, 16 Aug 2014 08:31:16 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Vec() and leading zeros of generating function
|
- To: Kevin Ryde <user42_kevin@yahoo.com.au>
- Subject: Re: Vec() and leading zeros of generating function
- From: Loïc Grenié <loic.grenie@gmail.com>
- Date: Sat, 16 Aug 2014 08:31:08 +0200
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Sat, 16 Aug 2014 08:31:16 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=UYWAnKT/KDw0o7aRNe/wBDQgzZ8t0rLcbTsDkL+ZwnU=; b=kvubR0DCCABfuDcIjohC7YxLzhcFV7QyiEkATeFkDzZ9hquDZUFji1hfQ5nPzzRsJI 22Q8IQ1PRYIpk/QCwtUJkajYqfIz0isZi8RMgkQyrnWuG5WMuFvUKBSNz/R+3gQcZHfo cBptISgCH31wbA/raHzxbtk9X2VdtuWQ3E/Qxrdn+oRYcWT2OYizGoRLlIbtbXA9bqC0 b+mJX9ZLYq95kicszIvA7sPt+NTmEaO2EKs1uqW02WAfZA2GF+E/cW/eBpeaGSvOPsWj irT/DCVbKbZ/gHXAXHzFLMRYUWumZ4/c5i2AgC5NlwAjl5PswKyV/xEujs5kymN/y9HQ DJ7w==
- In-reply-to: <87r40hugz1.fsf@blah.blah>
- References: <87r40hugz1.fsf@blah.blah>
2014-08-16 7:43 GMT+02:00 Kevin Ryde <user42_kevin@yahoo.com.au>:
> Vec() can give terms from a polynomial generating function but it
> doesn't include leading zeros. Eg.
>
> Vec(x^2/(1-2*x) + O(x^5))
> =>
> [1, 2, 4]
>
> Is there a good way to start from the zero'th term so I would get
>
> [0, 0, 1, 2, 4]
There is a genuine problem if your series have negative valuation.
If your series always have non-negative valuation, you can do:
sertovec(s)=concat(vector(valuation(s,variable(s))),Vec(s))
and use sertovec instead of Vec. The function is not robust and
will fail if s has negative valuation.
Hope this helps,
Loïc