login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of partitions of n into 3 nonprime parts.
9

%I #33 Mar 28 2021 12:11:59

%S 1,0,0,1,0,1,1,1,2,2,2,3,2,4,5,5,5,7,6,9,8,11,10,13,12,16,14,19,16,22,

%T 19,26,22,29,27,33,28,39,33,42,38,47,43,53,45,58,52,63,59,70,61,77,68,

%U 83,76,91,79,98,88,105,95,115,102,121,111,130,119,141,124,148

%N Number of partitions of n into 3 nonprime parts.

%p b:= proc(n, i, t) option remember; `if`(n=0,

%p `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+

%p `if`(isprime(i), 0, b(n-i, min(n-i, i), t-1))))

%p end:

%p a:= n-> b(n$2, 3):

%p seq(a(n), n=3..72); # _Alois P. Heinz_, Feb 12 2021

%t b[n_, i_, t_] := b[n, i, t] = If[n == 0,

%t If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +

%t If[PrimeQ[i], 0, b[n - i, Min[n - i, i], t - 1]]]];

%t a[n_] := b[n, n, 3];

%t a /@ Range[3, 72] (* _Jean-François Alcover_, Mar 28 2021, after _Alois P. Heinz_ *)

%Y Cf. A002095, A005171, A018252, A062610, A068307, A341451, A341452, A341453, A341454, A341455, A341457.

%K nonn

%O 3,9

%A _Ilya Gutkovskiy_, Feb 12 2021