login
Least integer k such that n!+1-k is prime.
0

%I #4 Mar 02 2012 12:41:18

%S 0,0,0,0,2,8,2,2,32,14,12,0,2,24,2,48,54,60,42,102,32,32,74,90,74,150,

%T 38,0,102,32,2,62,2,2,194,114,128,0,2,74,84,0,80,110,110,54,90,80,104,

%U 60,98,180,68,60,128,62,462,278,110,138,140,72,72,102,360,128,318,192

%N Least integer k such that n!+1-k is prime.

%C 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. n!+1 itself may be a prime number as in the case of n=3, 11, 27 (see A002981 for all such n). Now a(n) measures, when the first prime number previous to n!+2 appears. Thus a(n)=8 means that n!+1-3 is prime and so on. Obviously, the values of a(n) are always even numbers. Conjectures: |a(n)-1| is either 1 or a prime number. Is the growth of b(n) := sum(a(k),k=0..n) quadratic, that is b(n)=O(n^2)?

%e a(3)=0 because 3!+1-0=7 is prime.

%e a(4)=2 because 4!+1-2=23 is prime and 24 and 25 are not.

%p a := proc(n) option remember;n!+1-prevprime(n!+2); end;

%Y Cf. A090786, A002981, A005095.

%K nonn

%O 0,5

%A Frederick Magata (frederick.magata(AT)uni-muenster.de), Feb 28 2004