[seqfan] Re: checking a sequence before submission

Douglas McNeil mcneil at hku.hk
Wed Dec 22 19:26:40 CET 2010


In very unoptimized Sage:

## testing DN's seq
##

N = 38
s = 1
for n in range(1, N):
    parts = list(Partitions(n, max_slope=-1))
    max_length = max(len(part) for part in parts)
    longest = list(part for part in parts if len(part) == max_length)
    s += sum( (x**n / prod(1-x**i for i in part)) for part in longest)

t = taylor(s, x, 0, N-1)
c = [t.coeff(x,i) for i in range(N)]

sage: c
[1, 1, 2, 2, 4, 6, 7, 10, 14, 20, 24, 32, 40, 54, 69, 86, 106, 135,
165, 206, 256, 311, 378, 460, 555, 670, 808, 970, 1156, 1380, 1638,
1938, 2296, 2706, 3188, 3752, 4390, 5136]


Doug

-- 
Department of Earth Sciences
University of Hong Kong



More information about the SeqFan mailing list