OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n=1..4084 (terms less than 2*10^9)
MATHEMATICA
terms = 100; a = Table[0, {terms}]; s={}; k=0; A079848list = Reap[For[p=2, p < 10^5, p = NextPrime[p], j=1; While[j <= k && FreeQ[s, p-a[[j]]], j++]; If[j>k, For[j=1, j <= k, j++, s = Union[s, {p-a[[j]]}]]; k++; a[[k]] = p; Print[p]; Sow[p]; If[k == terms, Break[]]]]][[2, 1]]; (* Jean-François Alcover, Nov 02 2016, adapted from Max Alekseyev's PARI code *)
PROG
(PARI) a=vector(100); s=Set(); k=0; forprime(p=2, 10^5, j=1; while(j<=k&&!setsearch(s, p-a[j]), j++); if(j>k, for(j=1, k, s=setunion(s, [p-a[j]])); k++; a[k]=p; print1(" ", p); if(k==100, break))) \\ Max Alekseyev, Feb 14 2005
(Python)
from itertools import count, islice
from sympy import nextprime
def A079848_gen(): # generator of terms
aset2, alist, k = set(), [], 0
while (k:=nextprime(k)):
bset2 = set()
for a in alist:
if (b:=k-a) in aset2:
break
bset2.add(b)
else:
yield k
alist.append(k)
aset2.update(bset2)
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
Amarnath Murthy, Feb 18 2003
EXTENSIONS
More terms from Max Alekseyev, Feb 14 2005
STATUS
approved