OFFSET
1,2
COMMENTS
a(n) is also the sum of the differences between the sum of m-th largest and the sum of (m+1)st largest elements in all partitions of n for all nonprimes m. - Omar E. Pol, Oct 27 2012
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
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)
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 *)
PROG
(PARI) vector(100, n, sum(k=1, n, (numdiv(k)-omega(k))*numbpart(n-k))) \\ Altug Alkan, Oct 29 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Omar E. Pol, Sep 11 2008
STATUS
approved