login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of k >= 1 that make n + k! and n - k! both prime.
1

%I #18 Aug 17 2014 02:57:27

%S 0,0,0,1,1,1,0,0,1,0,1,1,1,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,1,1,0,0,0,0,

%T 2,0,2,0,1,0,0,1,1,0,1,0,2,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,2,0,1,0,

%U 1,0,0,1,1,0,0,0,2,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0

%N Number of k >= 1 that make n + k! and n - k! both prime.

%C 0 <= a(n) <= min{A125162(n), A175940(n)}.

%C a(n) < A020639(n). - _Robert Israel_, Aug 12 2014

%H Jens Kruse Andersen, <a href="/A242041/b242041.txt">Table of n, a(n) for n = 1..10000</a>

%p a:= n -> nops(select(k -> isprime(n+k!) and isprime(n-k!),

%p [$1 ..min(numtheory:-factorset(n))-1])):

%p 0, seq(a(n),n=2..100); # _Robert Israel_, Aug 12 2014

%o (PARI)

%o a(n)=c=0;for(k=1,n,if(ispseudoprime(n+k!)&&ispseudoprime(n-k!),c++));return(c)

%o vector(100,n,a(n))

%Y Cf. A020639, A125162, A175940.

%K nonn

%O 1,35

%A _Derek Orr_, Aug 12 2014