login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A355158 Number of partitions of n that contain more nonprime parts than prime parts. 2

%I #38 Jun 30 2022 14:42:49

%S 0,1,1,1,3,4,5,8,12,16,24,29,42,57,74,97,132,165,217,279,355,453,576,

%T 717,908,1135,1408,1751,2169,2664,3283,4022,4909,5990,7282,8814,10681,

%U 12885,15506,18643,22362,26739,31970,38100,45340,53878,63908,75639,89476,105580,124445

%N Number of partitions of n that contain more nonprime parts than prime parts.

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%F a(n) = A000041(n) - A155515(n) - A355225(n).

%F a(n) = A355306(n) - A355225(n).

%e For n = 8 the partitions of 8 that contain more nonprime parts than prime parts are [8], [4, 4], [4, 3, 1], [6, 1, 1], [4, 2, 1, 1], [5, 1, 1, 1], [3, 2, 1, 1, 1], [4, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1], [3, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]. There are 12 of these partitions so a(8) = 12.

%o (PARI) a(n) = my(nb=0); forpart(p=n, if (#select(x->!isprime(x), Vec(p)) > #p/2, nb++)); nb; \\ _Michel Marcus_, Jun 25 2022

%o (Python)

%o from sympy import isprime

%o from sympy.utilities.iterables import partitions

%o def c(p): return 2*sum(p[i] for i in p if not isprime(i)) > sum(p.values())

%o def a(n): return sum(1 for p in partitions(n) if c(p))

%o print([a(n) for n in range(51)]) # _Michael S. Branicky_, Jun 28 2022

%Y Cf. A000040, A000041, A000607, A002095, A002096, A018252, A155515, A355225, A355306.

%K nonn

%O 0,5

%A _Omar E. Pol_, Jun 24 2022

%E More terms from _Michel Marcus_, Jun 25 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 14 11:50 EDT 2024. Contains 375159 sequences. (Running on oeis4.)