OFFSET
0,2
COMMENTS
Empirically a(n) ~ (e*n/4)^2; n-th gap a(n) - a(n-1) = k(n) ~ sqrt(e*n); the number of primes pi(a(n)) = n^(2*e/7).
EXAMPLE
a(0) = 1, k(0) = 1;
1 + 1 = 2 is prime, a(1) = 2, k(1) = 1;
2 + 1 = 3 is prime, a(2) = 3, k(2) = 1;
3 + 1 = 4 is not a prime, a(3) = 3 + 1 + 1 = 5, k(3) = 2;
5 + 2 = 7 is prime, a(4) = 7, k(4) = 2;
7 + 2 = 9 is not a prime, a(5) = 7 + 2 + 1 = 10, k(5) = 3;
and so on.
MATHEMATICA
a[0] = {1, 1}; a[n_] := a[n] = If[PrimeQ[(s = Plus @@ a[n - 1])], {s, a[n - 1][[2]]}, {s, a[n - 1][[2]]} + 1]; First /@ Array[a, 50, 0] (* Amiram Eldar, Sep 03 2020 *)
PROG
(PARI) lista(nn) = {my(a = 1, k = 1, list = List()); for (n=1, nn, listput(list, a); if (isprime(a+k), a += k, a += k+1; k++); ); Vec(list); } \\ Michel Marcus, Sep 01 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Sep 01 2020
EXTENSIONS
More terms from Michel Marcus, Sep 01 2020
STATUS
approved