OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MAPLE
A120365 := proc(nmax) local a, lcomp, lpr, anew ; a := [3, 4] ; lcomp := 4 ; lpr := 3 ; while nops(a) < nmax do anew := lcomp+lpr ; a := [op(a), anew] ; if isprime(anew) then lpr := max(lpr, anew) ; else lcomp := max(lcomp, anew) ; fi ; od ; RETURN(a) ; end ; print(A120365(80) ) ; # R. J. Mathar, Dec 16 2006
MATHEMATICA
lclp[{c_, p_, a_}]:=Module[{x=c+p, c1, p1}, If[PrimeQ[x], {p1=x, c1=c}, {p1=p, c1=x}]; {c1, p1, p+c}]; Join[{3, 4}, NestList[lclp, {4, 7, 7}, 50][[;; , 3]]] (* Harvey P. Dale, Jul 29 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jun 26 2006
EXTENSIONS
More terms from R. J. Mathar, Dec 16 2006
STATUS
approved