This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A155515 #32 Jul 02 2022 09:31:41 %S A155515 1,0,0,1,1,0,3,2,3,5,4,8,12,10,15,23,22,33,42,47,64,79,90,122,147,169, %T A155515 219,264,312,387,465,546,679,799,950,1151,1365,1599,1937,2270,2678, %U A155515 3181,3735,4374,5192,6046,7082,8318,9684,11281,13208,15313,17798,20702,23951 %N A155515 Number of partitions of n into as many primes as nonprimes. %H A155515 Alois P. Heinz, <a href="/A155515/b155515.txt">Table of n, a(n) for n = 0..1000</a> %H A155515 <a href="/index/Par#part">Index entries for sequences related to partitions</a> %F A155515 a(n) = A000041(n) - A355306(n). - _Omar E. Pol_, Jun 30 2022 %e A155515 a(9) = #{6+3, 5+4, 5+2+1+1, 4+2+2+1, 2+2+2+1+1+1} = 5; %e A155515 a(10) = #{8+2, 5+3+1+1, 4+3+2+1, 3+2+2+1+1+1} = 4. %p A155515 b:= proc(n, i, t) local m; m:= n- `if`(t>0, t, -2*t); if m<0 then 0 elif n=0 then 1 elif i<3 then `if`(irem(m,3)=0, 1, 0) else b(n, i, t):= b(n-i, i, t+ `if`(isprime(i), 1, -1)) +b(n, i-1, t) fi end: a:= n-> b(n, n, 0): seq(a(n), n=0..60); # _Alois P. Heinz_, Apr 30 2009 %t A155515 pnpQ[n_]:=Count[n,_?PrimeQ]==Length[n]/2; Table[Count[ IntegerPartitions[ n], _?pnpQ],{n,60}] (* _Harvey P. Dale_, Feb 02 2014 *) %t A155515 b[n_, i_, t_] := b[n, i, t] = Module[{m}, m = n - If[t > 0, t, -2t]; Which[m < 0, 0, n == 0, 1, i < 3, If[Mod[m, 3] == 0, 1, 0], True, b[n, i, t] = b[n-i, i, t + If[PrimeQ[i], 1, -1]] + b[n, i-1, t]]]; %t A155515 a[n_] := b[n, n, 0]; %t A155515 a /@ Range[0, 60] (* _Jean-François Alcover_, May 30 2021, after _Alois P. Heinz_ *) %o A155515 (PARI) %o A155515 parts(n)={1/(prod(k=1, n, 1 - if(isprime(k), y, 1/y)*x^k + O(x*x^n)))} %o A155515 {my(n=60); apply(p->polcoeff(p,0), Vec(parts(n)))} \\ _Andrew Howroyd_, Dec 29 2017 %o A155515 (Python) %o A155515 from sympy import isprime %o A155515 from sympy.utilities.iterables import partitions %o A155515 def c(p): return 2*sum(p[i] for i in p if isprime(i)) == sum(p.values()) %o A155515 def a(n): return sum(1 for p in partitions(n) if c(p)) %o A155515 print([a(n) for n in range(55)]) # _Michael S. Branicky_, Jun 30 2022 %Y A155515 Cf. A000041, A000607, A002095, A027187, A355306. %K A155515 nonn %O A155515 0,7 %A A155515 _Reinhard Zumkeller_, Jan 23 2009