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!)
A355306 Number of partitions of n in which the number of prime parts is not equal to the number of nonprime parts. 3

%I #27 Jul 16 2022 17:16:42

%S 0,1,2,2,4,7,8,13,19,25,38,48,65,91,120,153,209,264,343,443,563,713,

%T 912,1133,1428,1789,2217,2746,3406,4178,5139,6296,7670,9344,11360,

%U 13732,16612,20038,24078,28915,34660,41402,49439,58887,69983,83088,98476,116436,137589,162244,191018

%N Number of partitions of n in which the number of prime parts is not equal to the number of nonprime parts.

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

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

%F a(n) = A355158(n) + A355225(n).

%e For n = 6 the partitions of 6 in which the number of prime parts is not equal to the number of nonprime parts are [6], [3, 3], [2, 2, 2], [3, 2, 1], [4, 1, 1], [3, 1, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], there are eight of these partitions so a(6) = 8.

%t Array[Count[IntegerPartitions[#], _?(#1 - #2 != #2 & @@ {Length[#], Count[#, _?PrimeQ]} &)] &, 51, 0] (* _Michael De Vlieger_, Jul 15 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 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

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

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

%K nonn

%O 0,3

%A _Omar E. Pol_, Jun 28 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 July 7 03:15 EDT 2024. Contains 374062 sequences. (Running on oeis4.)