%N Define u such that u(1) = k and u(n) = u(n-1) + (-1)^n*(n!) for n > 1. Terms are numbers k for which the number of consecutive values of u(i), starting at u(1) = k, that are primes reaches a new record high.
%e If k = 2, u(1) = 2 is prime, and no lesser number has this property, thus 2 is a term.
%e If k = 11, u(1) = 11, u(2) = 11 + 2! = 13, u(3) = 13 - 3! = 7 and u(4) = 7 + 4! = 31 are primes, and no lesser number has this property, thus 11 is a term.
%o rec(kk=10^9)=my(r=0);forprime(k=1,kk,x=card(k);if(x>r,if(r>0,print1(", "));print1(k);r=x))
%A _Jean-Marc Rebert_, Nov 23 2022