OFFSET
1,3
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..4792
EXAMPLE
Among the first 8 terms of the sequence, 9 is the largest nonprime. So a(10) = a(9) + 9 = 22 + 9 = 31.
MAPLE
isA018252 := proc(n) if n = 1 or not isprime(n) then true ; else false ; fi ; end: A120760 := proc(nmin) local a, lnpr, k; a := [1, 1, 2] ; while nops(a) < nmin do lnpr :=0 ; for k in [op(1..nops(a)-1, a)] do if isA018252(k) then lnpr := max(lnpr, k) ; fi ; od: a := [op(a), a[ -1]+lnpr] ; od: RETURN(a) ; end: A120760(80) ; # R. J. Mathar, Sep 18 2007
MATHEMATICA
s={1, 1}; Do[AppendTo[s, s[[-1]]+Max[Select[Drop[s, -1], !PrimeQ[#]&]]], {n, 3, 40}]; s (* James C. McMahon, Oct 09 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 03 2006
EXTENSIONS
More terms from R. J. Mathar, Sep 18 2007
STATUS
approved