login
A154661
Numbers n such that n! + 257 and abs(n! - 257) are both prime.
4
3, 4, 6, 7, 8, 18
OFFSET
1,1
COMMENTS
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
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
EXAMPLE
6! - 257 = 463 and 6! + 257 = 977, both prime, so 6 is a term.
MATHEMATICA
lst={}; a=257; Do[If[PrimeQ[n!-a]&&PrimeQ[n!+a], AppendTo[lst, n]], {n, 2*5!}]; lst
PROG
(PARI) isok(n) = isprime(abs(n!-257)) && isprime(n!+257); \\ Michel Marcus, Mar 12 2017
CROSSREFS
Sequence in context: A322376 A376424 A044813 * A275672 A087753 A233334
KEYWORD
nonn,fini,full
AUTHOR
EXTENSIONS
Name corrected and fini, full keywords by Michel Marcus, Mar 12 2017
STATUS
approved