This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A090786 #27 Apr 21 2021 12:52:30 %S A090786 0,0,0,1,0,1,0,3,14,7,0,5,16,53,4,27,6,13,18,69,8,9,8,73,106,15,32,19, %T A090786 38,193,76,95,46,3,62,25,94,273,4,57,12,19,54,27,2,193,54,185,4,33,10, %U A090786 219,0,17,168,15,92,49,224,233,210,707,68,207,2,127,216,5,14,61,68,785 %N A090786 Least nonnegative integer k such that n! + n + k + 1 is prime. %C A090786 The (n-1) consecutive numbers n!+2, ..., n!+n (for n >= 2) are not prime. This fact implies that there are arbitrarily large gaps in the distribution of the prime numbers. However, n!+n+1 need not be a prime number. Now a(n) measures, when the next prime number after n!+n appears. Thus a(n)=0 means that n!+n+1 is prime and so on. Obviously, a(n) is parity conserving for n >= 2. I.e., if n >= 2 then 2 divides n iff 2 divides a(n). %C A090786 Conjectures: By definition a(n)+n!+1 is prime, but is a(n)+n+1=A037153(n) also a prime number for all n > 2? Is the growth of b(n) := Sum_{k=0..n} a(k) quadratic, that is, is b(n)=O(n^2)? %H A090786 Seiichi Manyama, <a href="/A090786/b090786.txt">Table of n, a(n) for n = 0..500</a> %e A090786 a(5)=1 because 5!+5+1+1=127 is prime and 126 is not. %e A090786 a(7)=3 because 7!+7+3+1=5051 is prime and 5048, 5049 and 5050 are not prime. %p A090786 a := proc(n) option remember;local r,m,k: r := n!+n: k := 1: m := r+1: while (not isprime(m)) do k := k+1: while (not igcd(k,n)=1) do k := k+1: od: m := r+k: od: k-1; end; %p A090786 # alternatively: %p A090786 a := proc(n) option remember; nextprime(n!+n)-n!-n-1; end; %t A090786 lnik[n_]:=Module[{c=n!+n+1},If[PrimeQ[c],0,NextPrime[c]-c]]; Array[ lnik, 80,0] (* _Harvey P. Dale_, Apr 08 2019 *) %o A090786 (PARI) a(n) = apply(x->(nextprime(x)-x), n!+n+1); \\ _Michel Marcus_, Mar 21 2018 %Y A090786 Cf. A005095, A037153, A073308. %K A090786 nonn %O A090786 0,8 %A A090786 Frederick Magata (frederick.magata(AT)uni-muenster.de), Feb 09 2004