[seqfan] Re: A000207: Maple-Program wrong

Richard Mathar mathar at strw.leidenuniv.nl
Sun Apr 19 14:39:29 CEST 2009


rr> From seqfan-bounces at list.seqfan.eu Sun Apr 19 13:54:13 2009
rr> Date: Sun, 19 Apr 2009 13:48:40 +0200
rr> From: Rainer Rosenthal <r.rosenthal at web.de>
rr> To: Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
rr> Subject: [seqfan]  A000207: Maple-Program wrong
rr> ...
rr> The Maple program provided with A000207 does not
rr> work. It's not only the missing cases n=0,1,2 in
rr> the recursive program, as I tried to fix that,
rr> but without success.
rr> ..

The first Maple program returns values that are off by two indices,
and this can be repaired easily:

A000108 := proc(n)
        if n >= 0 then
                binomial(2*n,n)/(n+1) ;
        else
                0;
        fi;
end:
A000207 := proc(n)
        option remember:
        local k, it1, it2;
        if n mod 2 = 0 then
                k := n/2+2
        else
                k := (n+3)/2
        fi:
        if n mod 2 <> 0 then
                it1 := 0
        else
                it1 := 1
        fi:
        if (n+2) mod 3 <> 0 then
                it2 := 0
        else
                it2 := 1
        fi:
        RETURN(A000108(n)/(2*n+4) + it1*A000108(n/2)/4 + A000108(k-2)/2 + it2*A000108((n-1)/3)/3)
end:


seq(A000207(n),n=1..30) ;


The second maple program is correct and returns A000207
with correct values and offset:

G:=(12*(1+x-2*x^2)+(1-4*x)^(3/2)-3*(3+2*x)*(1-4*x^2)^(1/2)-4*(1-4*x^3)^(1/2))/24/x^2:
Gser:=series(G, x=0, 35):
seq(coeff(Gser, x^n), n=1..31);





More information about the SeqFan mailing list