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

Robert G. Wilson v rgwv at rgwv.com
Thu Jul 15 00:37:36 CEST 2010

```Et al,

I concur with the sequence below by Richard Mathar. The Mathematica
coding is:
fQ[lst_List] := Union[ PrimeQ@# || # == 1 & /@ lst] == {True} && Sort@
Flatten@ Most@ Split@ lst == Rest@ Union@ lst;
f[n_] := Count[ Flatten@ Select[ IntegerPartitions at n, fQ@# &], 1]; Array[f,
50]

Bob.

--------------------------------------------------
From: "Douglas McNeil" <mcneil at hku.hk>
Sent: Wednesday, July 14, 2010 10:55 AM
To: "Sequence Fanatics Discussion list" <seqfan at list.seqfan.eu>
Subject: [seqfan] Re: checking A179385 (parts equal to 1 in
restrictedpartitions of n)

> On Wed, Jul 14, 2010 at 10:09 PM, 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?
>
> I agree-- assuming I understand the sequence description correctly,
> that is (I read it as you do.)
>
> # sage code
> a = []
> for n in IntegerRange(1, 50):
>    parts = [1] + list(primes(n+1))
>    ones_count = 0
>    for part in Partitions(n, parts_in=parts):
>        part = list(part)
>        if all((x==1) or (is_prime(x) and part.count(x) == 1) for x in
> part):
>            ones_count += part.count(1)
>    a += [ones_count]
>
> sage: a
> [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]
>
>
> Doug
>
> --
> Department of Earth Sciences
> University of Hong Kong
>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>

```