%I #23 Mar 13 2017 04:28:02
%S 3,4,6,7,8,18
%N Numbers n such that n! + 257 and abs(n! - 257) are both prime.
%C Sequence is the intersection of two sequences: n such that n! + 257 is prime (i.e., 3, 4, 6, 7, 8, 18, 22, 35, 93, 97, 125, 137, 153, ...) and n such that abs(n! - 257) is prime (i.e., 3, 4, 5, 6, 7, 8, 15, 18, 20, 25, 28, 51, 79, 80, ...). - _Jon E. Schoenfield_, Mar 12 2017
%C Sequence is complete since there no other terms up to 256 included, and then n! + 257 and abs(n! - 257) are both multiples of 257 for n>=257. - _Michel Marcus_, Mar 12 2017
%e 6! - 257 = 463 and 6! + 257 = 977, both prime, so 6 is a term.
%t lst={};a=257;Do[If[PrimeQ[n!-a]&&PrimeQ[n!+a],AppendTo[lst,n]],{n,2*5!}];lst
%o (PARI) isok(n) = isprime(abs(n!-257)) && isprime(n!+257); \\ _Michel Marcus_, Mar 12 2017
%Y Cf. A144046, A154660.
%K nonn,fini,full
%O 1,1
%A _Vladimir Joseph Stephan Orlovsky_, Jan 13 2009
%E Name corrected and fini, full keywords by _Michel Marcus_, Mar 12 2017
|