# [seqfan] Re: checking A179385 (parts equal to 1 in restricted partitions of n)

Max Alekseyev maxale at gmail.com
Wed Jul 14 20:37:43 CEST 2010

I do confirm as well.

? a(n) = local(r); r = x/(1-x)^2 + O(x^(n+1));
forprime(p=2,n,r*=1+x^p); polcoeff(r,n)

? vector(100,n,a(n))
%1 = [1, 2, 4, 7, 10, 15, 20, 27, 35, 44, 55, 67, 81, 97, 115, 135,
158, 183, 212, 244, 280, 320, 364, 413, 467, 526, 591, 661, 737, 820,
909, 1007, 1112, 1226, 1349, 1481, 1624, 1778, 1943, 2121, 2311, 2515,
2734, 2968, 3219, 3486, 3771, 4075, 4399, 4744, 5112, 5502, 5917,
6358, 6826, 7324, 7851, 8410, 9001, 9627, 10290, 10992, 11734, 12518,
13346, 14219, 15142, 16115, 17141, 18222, 19360, 20559, 21822, 23152,
24552, 26023, 27570, 29195, 30903, 32698, 34582, 36559, 38632, 40807,
43088, 45480, 47986, 50611, 53358, 56235, 59248, 62401, 65701, 69151,
72757, 76527, 80467, 84585, 88886, 93375]

btw, there is also formula

A179385(n) = \sum_{k=1}^n k * A000586(n-k)

Max

On Wed, Jul 14, 2010 at 10:09 AM, Richard Mathar
<mathar at strw.leidenuniv.nl> wrote:
>
> I am unable to reproduce http://oeis.org/classic/A179385
> (count of parts equal to 1 in all partitions of n, all parts
> either 1 or prime, and no repeated prime in any partition)
> 1, 2, 4, 7, 10, 15, 20, 27, 35, 44, 55, 67, 81, 97, 115, 135, 158, 183, 212,
>    244, 280, 320, 364, 413, 467, 526, 591, 661, 737, 820, 909, 1007, 1112,
>    1226, 1349
>
> Can someone confirm/check this modification?
>
> A179385 := proc(n)
>        local p,a ;
>        ps := combinat[partition](n) ;
>        # the number to be returned
>        a := 0 ;
>        # loop over all possible partitions of n
>        for  p in ps do
>                # set of all the primes seen so far in the partition
>                pbag := {} ;
>                # flag to indicate that this is a valid partition
>                wrks := true ;
>                # loop over the parts in that partition
>                for c in p do
>                        # reject partition with composites
>                        if c >1 and not isprime(c) then
>                                wrks := false;
>                        end if;
>                        # reject partition with repeated primes
>                        if c >1 and c in pbag then
>                                wrks := false;
>                        end if;
>                        # put the 1s and primes into the bag to remember
>                        pbag := pbag union {c} ;
>                end do:
>                # that's an allowed parition: add all its 1's to the result
>                if wrks then
>                        for c in p do
>                                if c =1 then
>                                        a := a+1 ;
>                                end if;
>                        end do:
>                end if;
>        end do:
>        a ;
> end proc:
> seq(A179385(n),n=1..35) ;
>
>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>