A144119 Total number of nonprime parts in all partitions of n.
1, 2, 4, 8, 13, 22, 34, 54, 80, 119, 170, 246, 342, 478, 653, 894, 1198, 1610, 2127, 2813, 3672, 4789, 6181, 7975, 10192, 13010, 16488, 20861, 26224, 32918, 41086, 51199, 63494, 78599, 96888, 119235, 146167, 178879, 218181, 265662, 322487, 390834, 472343
Offset: 1
Examples
From _Omar E. Pol_, Nov 20 2011 (Start): For n = 6 we have: -------------------------------------- . Number of Partitions nonprime parts -------------------------------------- 6 .......................... 1 3 + 3 ...................... 0 4 + 2 ...................... 1 2 + 2 + 2 .................. 0 5 + 1 ...................... 1 3 + 2 + 1 .................. 1 4 + 1 + 1 .................. 3 2 + 2 + 1 + 1 .............. 2 3 + 1 + 1 + 1 .............. 3 2 + 1 + 1 + 1 + 1 .......... 4 1 + 1 + 1 + 1 + 1 + 1 ...... 6 ------------------------------------ Total ..................... 22 So a(6) = 22. (End)
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
Programs
-
Maple
b:= proc(n, i) option remember; local g; if n=0 then [1, 0] elif i<1 then [0, 0] else g:= `if`(i>n, [0$2], b(n-i, i)); b(n, i-1) +g +[0, `if`(isprime(i), 0, g[1])] fi end: a:= n-> b(n, n)[2]: seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Mathematica
b[n_, i_] := b[n, i] = Module[{g}, If[n == 0, {1, 0}, If[i<1, {0, 0}, g = If[i>n, {0, 0}, b[n-i, i]]; b[n, i-1] + g + {0, If[PrimeQ[i], 0, g[[1]]]} ]]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 29 2015, after Alois P. Heinz *)
-
PARI
vector(100, n, sum(k=1, n, (numdiv(k)-omega(k))*numbpart(n-k))) \\ Altug Alkan, Oct 29 2015
Comments