OFFSET
0,2
COMMENTS
Collected primes from a(1) on: 2, 3, 5, 7, 53, 157, 1811, 9949, 303283, 49730477, ...
If we drop the unicity constraint, then we obtain: 0, 2, followed by the prime gaps (A001223). - Rémy Sigrist, Aug 07 2018
a(11) > 1.3*10^10. - Giovanni Resta, Aug 09 2018
EXAMPLE
a(0) = 0, no prime.
a(1) = 2, one prime: 2.
a(2) = 1, two primes: 2 and 1 + 2 = 3.
a(3) = 3, three primes: 2, 3 and 3 + 2 = 5.
a(4) = 4, four primes: 2, 3, 3 + 2 = 4 + 1 = 5 and 4 + 3 = 4 + 2 + 1 = 7.
Next term is a(5) = 48 because any integer from 5 to 47 generates more than 5 primes. For instance, 33 gives 33 + 4 = 37 and 33 + 4 + 3 + 1 = 41 that with 2, 3, 5 and 7 sum to 6 primes.
MAPLE
with(combinat): P:=proc(q) local a, c, d, f, g, j, k, n, ok, x; a:=[0, 2]; print(0); print(2); x:=1; for n from 2 to q do for j from x to q do if numboccur(a, j)=0 then c:=[op(a), j]; d:=choose(c); f:={}; for k from 1 to nops(d) do g:=convert(d[k], `+`); if isprime(g) then f:=f union {g}; fi; od; ok:=1; if nops(f)=n then for k from 1 to n do if numboccur(f, f[k])>1 then ok:=0; break; fi; od; else ok:=0; fi; if ok=1 then a:=[op(a), j]; x:=j+1; print(j); break; fi; fi; od; od; end: P(10^9);
MATHEMATICA
a = s = {0}; p = {}; Do[t=1; While[MemberQ[a, t] || Length[q = Union[p, Select[s + t, PrimeQ]]] != n, t++]; AppendTo[a, t]; p = q; s = Union[s, s + t], {n, 8}]; a (* Giovanni Resta, Aug 09 2018 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Paolo P. Lava, Aug 06 2018
EXTENSIONS
a(10) from Giovanni Resta, Aug 07 2018
STATUS
approved