OFFSET
2,2
COMMENTS
LINKS
Clark Kimberling, Table of n, a(n) for n = 2..1000
EXAMPLE
n... s(n) .. a(n) .... s-greedy sum for s(n)
1 ... 1 .... (none).. (undefined)
2 ... 2 .... 1 ....... 1
3 ... 3 .... 2 ....... 2 + 1
4 ... 5 .... 2 ....... 3 + 2
5 ... 7 .... 2 ....... 5 + 2
6 ... 11 ... 3 ....... 7 + 3 + 1
7 ... 15 ... 3 ....... 11 + 3 + 1
8 ... 22 ... 2 ....... 15 + 7
9 ... 30 ... 3 ....... 22 + 7 + 1
10 .. 42 ... 3 ....... 30 + 11 + 1
11 .. 56.... 4 ....... 42 + 11 + 3
12 .. 77.... 3 ....... 56 + 11 + 5 + 1
MATHEMATICA
z = 200; s = Table[PartitionsP[n], {n, 1, z}]; t = Table[{s[[n]], #, Total[#] == s[[n]]} &[DeleteCases[-Differences[FoldList[If[#1 - #2 >= 0, #1 - #2, #1] &, s[[n]], Reverse[Select[s, # < s[[n]] &]]]], 0]], {n, z}]; r[n_] := s[[n]] - Total[t[[n]][[2]]]; c = Table[Length[t[[n]][[2]]], {n, 2, z}] (* Peter J. C. Moses, May 06 2014 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 10 2014
STATUS
approved