OFFSET
1,1
COMMENTS
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..500
EXAMPLE
a(n) ... a(n)-th prime .... primes-greedy sum
3 ...... 5 ................ 3 + 2
4 ...... 7 ................ 5 + 2
6 ...... 13 ............... 11 + 2
8 ...... 19 ............... 17 + 2
35 ..... 149 .............. 139 + 7 + 3
MATHEMATICA
z = 200; s = Table[Prime[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]]]; tr = Table[r[n], {n, 2, z}] (* A242252 *)
c = Table[Length[t[[n]][[2]]], {n, 2, z}] (* A242253 *)
f = 1 + Flatten[Position[tr, 0]] (* A242254 *)
Prime[f] (* A242255 *)
f1 = Prime[Complement[Range[Max[f]], f]] (* A242256 *)
(* Peter J. C. Moses, May 06 2014 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 09 2014
STATUS
approved