OFFSET
1,1
COMMENTS
Greedy sums and summability are defined at A242305.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..500
EXAMPLE
a(1) = 5 = 4 + 1; a(2) = 9 + 1
a(3) = 13 = 9 + 4; a(4) = 14 = 9 + 4 + 1.
MATHEMATICA
z = 200; s = Table[n^2, {n, 1, z}]; s1 = Table[n, {n, 1, z}]; t = Table[{s1[[n]], #, Total[#] == s1[[n]]} &[DeleteCases[-Differences[FoldList[If[#1 - #2 >= 0, #1 - #2, #1] &, s1[[n]],
Reverse[Select[s, # < s1[[n]] &]]]], 0]], {n, z}]
r[n_] := s1[[n]] - Total[t[[n]][[2]]];
tr = Table[r[n], {n, 2, z}] (* A242305 *)
c = Table[Length[t[[n]][[2]]], {n, 2, z}] (* A242306 *)
f = 1 + Flatten[Position[tr, 0]] (* A242307 *) (* Peter J. C. Moses, May 06 2014 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 11 2014
STATUS
approved