%I #19 Apr 08 2019 15:31:36
%S 2,7,13,5,53,1033,821,10133,9461,11,105276481,2201568973,35401,
%T 10445256498283,1945187598443,35849093549903
%N a(n) is the smallest prime p such that p + 6*t is also prime for every triangular number t up to, but not including, the n-th triangular number (or 0 if no such prime exists).
%C For n > 16, a(22)=23 is the only nonzero term up to 10^14. - _Bert Dobbelaere_, Apr 08 2019
%C An arithmetic progression such as {m, m+k, m+2k, m+3k, ...} where q is the largest prime that does not divide k cannot have more than q-1 successive prime terms (unless m = q). But is there a limit to the number of successive terms of a quadratic sequence like {m, m+k, m+3k, m+6k, m+10k, ..., m+(j*(j+1)/2)*k, ...}, starting with the initial term m, that can be prime?
%e a(1)=2 because 2 is prime but 2 + 6*T(1) = 2 + 6*1 = 8 is not prime, and there is no smaller prime for which this is the case.
%e a(4)=5 because 5, 5 + 6*1 = 11, 5 + 6*3 = 23, and 5 + 6*6 = 41 are all prime, but 5 + 6*10 = 65 is not prime, and there is no smaller prime for which this is the case.
%e a(22)=23: 23, 29, 41, 59, 83, 113, 149, 191, 239, 293, 353, 419, 491, 569, 653, 743, 839, 941, 1049, 1163, 1283, and 1409 are all prime, but 1541 is not.
%o (PARI) isok(p, n) = {my(t=0); for (k=1, n-1, t += k; if (! isprime(p+6*t), return (0));); t += n; !isprime(p+6*t);}
%o a(n) = {my(p=2); while (! isok(p, n), p = nextprime(p+1)); p;} \\ _Michel Marcus_, Mar 11 2019
%Y Cf. A000217 (triangular numbers).
%K nonn,more
%O 1,1
%A _Jon E. Schoenfield_, Mar 03 2019
%E a(14)-a(16) from _Bert Dobbelaere_, Apr 06 2019