close form solution for A136010 (per PURRS http://www.cs.unipr.it/purrs/)
Max Alekseyev
maxale at gmail.com
Sat Mar 29 19:43:55 CET 2008
On Sat, Mar 29, 2008 at 11:35 AM, Maximilian Hasler
<maximilian.hasler at gmail.com> wrote:
> Maple:
> A136010:=n->simplify((10+61/sqrt(85))*(7/2-1/2*sqrt(85))^n+(10-61/sqrt(85))*(7/2+1/2*sqrt(85))^n);
>
> PARI:
> A136010(n) = round((10+61/sqrt(85))*(7/2-1/2*sqrt(85))^n+(10-61/sqrt(85))*(7/2+1/2*sqrt(85))^n)
The latter is not that good since sqrt() in PARI is not precise but
floating-point function (in contrast to Maple, where it is symbolic by
default). Therefore, this function may give wrong results for large n
or an error like:
*** round: precision too low in truncr (precision loss in truncation).
In PARI it is better to use the following code that does not involve
any floating point operations:
A136010(n) = local(y=Mod(x,x^2-85));
lift((10+61/y)*(7/2-1/2*y)^n+(10-61/y)*(7/2+1/2*y)^n)
Regards,
Max
More information about the SeqFan
mailing list