OFFSET
1,2
MATHEMATICA
s = {1, 2, 3}; Do[a = s[[-1]] + s[[-2]] + s[[-3]]; n = 4; While[MemberQ[s, n] || ! PrimeQ[a + n], n++]; AppendTo[s, n], {120}]; s
PROG
(PARI) { s = 0; for (n=1, #a = vector(62), if (n<=3, a[n]=n, for (v=1, oo, if (!bittest(s, v) && isprime(v+a[n-1]+a[n-2]+a[n-3]), a[n]=v; break))); print1 (a[n]", "); s+=2^a[n]) } \\ Rémy Sigrist, Jul 03 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 13 2022
STATUS
approved