[seqfan] Summing ranks of partitions in A105805/7

Richard J. Mathar mathar at mpia-hd.mpg.de
Wed Jul 17 18:09:26 CEST 2013


I have troubles reproducing https://oeis.org/A105807
which comes out as
0, 1, 2, 4, 7, 12, 18, 29, 42, 61, 87, 125, 172, 235, 320,
435, 576, 756, 1004, 1323, 1698, 2166, 2784, 3617, 4562, 5765, 7176,
This differs for n>=16 from the current terms.

These numbers are implemented via A105805 in Maple by:

A000041 := proc(n)
    combinat[numbpart](n) ;
end proc:

# Compare two partitions (list) in AS order.
AScompare := proc(p1,p2)
    if nops(p1) > nops(p2) then
        return 1;
    elif nops(p1) < nops(p2) then
        return -1;
    else
        for i from 1 to nops(p1) do
            if op(i,p1) > op(i,p2) then
                return 1;
            elif op(i,p1) < op(i,p2) then
                return -1;
            end if;
            
        end do:
        return 0 ;
    end if;
end proc:
# Produce list of partitions in AS order
ASPrts := proc(n)
    option remember;
    local pi,insrt,p,ex ;
    pi := [] ;
    for p in combinat[partition](n) do
        insrt := 0 ;
        for ex from 1 to nops(pi) do
            if AScompare(p, op(ex,pi)) > 0 then
                insrt := ex ;
            end if;
        end do:
        if nops(pi) = 0 then
            pi := [p] ;
        elif insrt = 0 then
            pi := [p,op(pi)] ;
        elif insrt = nops(pi) then
            pi := [op(pi),p] ;
        else
            pi := [op(1..insrt,pi),p,op(insrt+1..nops(pi),pi)] ;
        end if;
    end do:
    return pi ;
end proc:
A105805 := proc(n,k)
    local pi;
    pi := ASPrts(n)[k] ;
    max(op(pi))-nops(pi) ;
end proc:
A105807 := proc(n)
    add( A105805(n,k),k=1..floor(A000041(n)/2)) ;
end proc:
for n from 1 do
    printf("%d,\n",A105807(n)) ;
end do:

The 16th row of A105805 looks like
15,13,12,11,10,9,8,7,6,11,10,9,8,7,6,5,9,8,7,6,5,4,7,6,5,4,5,4,3,3,9,8,7,6,5,4,
3,7,6,5,4,3,5,4,3,2,3,2,1,6,5,4,3,2,4,3,2,2,1,3,2,1,1,0,7,6,5,4,3,2,5,4,3,2,1,3,
2,1,1,0,4,3,2,1,2,1,0,0,1,0,-1,3,2,1,0,1,0,-1,0,-1,-1,5,4,3,2,1,0,3,2,1,0,1,0,
-1,-1,2,1,0,-1,0,-1,-2,-1,-2,1,0,-1,-1,-2,-2,-3,0,-1,-2,-2,-3,3,2,1,0,-1,1,0,-1,
-2,-1,-2,-3,0,-1,-2,-2,-3,-3,-1,-2,-3,-3,-4,-2,-3,-4,-3,-4,1,0,-1,-2,-3,-1,-2,
-3,-3,-4,-2,-3,-4,-4,-5,-3,-4,-5,-4,-5,-5,-6,-1,-2,-3,-4,-3,-4,-5,-5,-4,-5,-6,
-5,-6,-6,-7,-3,-4,-5,-6,-5,-6,-7,-6,-7,-7,-8,-5,-6,-7,-7,-8,-8,-9,-7,-8,-9,-9,
-10,-9,-10,-11,-11,-12,-13,-15
in my A105805(16,*).

Note that I fear that the Maple order of partitions (as used for example in A049085)
is not actually equivalent to the AS order, so the implementation above is
using a manual ordering of all partitions to ensure the AS order is in use.

Anyone to counter-check?

Richard



More information about the SeqFan mailing list