Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Sep 08 2022 08:45:37
%S 15,105,16065,19425,43785,1091265,1615845,1954365,2822715,2839935,
%T 3243345,3400215,6005895,6503595,7187775,7641375,8062005,8741145,
%U 10526565,11086845,11664555,14520555,14812875,14834715,14856765,16025835,16094715,18916485,19197255
%N Near-prime numbers: numbers n such that n-2=prime, n+2=prime, n-4=prime, n+4=prime, n-8=prime, n+8=prime.
%H Karl V. Keller, Jr., <a href="/A143727/b143727.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = 8 + A022008(n). - _R. J. Mathar_, Aug 31 2008
%e 15 is in the sequence since 15-2=13, 15+2=17, 15-4=11, 15+4=19, 15-8=7, and 15+8=23 are all prime.
%t lst={};Do[If[PrimeQ[n-2]&&PrimeQ[n+2]&&PrimeQ[n-4]&&PrimeQ[n+4]&&PrimeQ[n-8]&&PrimeQ[n+8],AppendTo[lst,n]],{n,5*10!}];lst
%t Mean/@Select[Partition[Prime[Range[123*10^4]],6,1],Differences[#]=={4,2,4,2,4}&] (* _Harvey P. Dale_, Oct 09 2018 *)
%o (Magma) [n: n in [0..2*10^7] | IsPrime(n-2) and IsPrime(n+2) and IsPrime(n-4)and IsPrime(n+4) and IsPrime(n-8) and IsPrime(n+8)]; /* or */ [8+p: p in PrimesUpTo(2*10^7) | IsPrime(p+4) and IsPrime(p+6) and IsPrime(p+10)and IsPrime(p+12) and IsPrime(p+16)]; // _Vincenzo Librandi_, Dec 01 2015
%o (PARI) isok(n) = isprime(n-2) && isprime(n+2) && isprime(n-4) && isprime(n+4) && isprime(n-8) && isprime(n+8); \\ _Michel Marcus_, Dec 16 2015
%K nonn,easy
%O 1,1
%A _Vladimir Joseph Stephan Orlovsky_, Aug 30 2008