cp's OEIS Frontend

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.

A242040 Numbers n such that n + k! and n - k! are both prime for some k.

This page as a plain text file.
%I A242040 #14 Aug 17 2014 02:50:59
%S A242040 4,5,6,9,11,12,13,15,17,18,21,23,25,29,30,35,37,39,42,43,45,47,53,55,
%T A242040 60,65,67,69,72,73,77,81,83,85,95,99,102,103,105,107,108,111,113,125,
%U A242040 127,129,131,133,137,138,143,145,149,150,151,155,157,161,163,165,173,175,180,185,187
%N A242040 Numbers n such that n + k! and n - k! are both prime for some k.
%C A242040 Subsequence of the complement of (A239321 union A125163).
%H A242040 Jens Kruse Andersen, <a href="/A242040/b242040.txt">Table of n, a(n) for n = 1..10000</a>
%e A242040 5 + 2! = 7 and 5 - 2! = 3 are both prime. Thus 5 is a member of this sequence.
%o A242040 (PARI)
%o A242040 a(n)=for(k=1,n,if(ispseudoprime(n+k!)&&ispseudoprime(n-k!),return(k)))
%o A242040 n=1;while(n<500,if(a(n),print1(n,", "));n++)
%Y A242040 Cf. A239321, A125163, A241425, A245716.
%K A242040 nonn
%O A242040 1,1
%A A242040 _Derek Orr_, Aug 12 2014