login
Numbers n such that 18n - 5 and 18n + 5 are primes.
1

%I #21 Sep 08 2022 08:45:50

%S 1,2,6,8,9,13,16,19,21,23,28,34,36,41,42,44,49,54,57,58,61,72,78,82,

%T 83,86,89,96,99,104,111,113,132,133,149,152,154,167,173,177,187,201,

%U 211,218,236,237,247,251,258,266,273,278,288,296,302,307,314,316,317,322

%N Numbers n such that 18n - 5 and 18n + 5 are primes.

%H Harvey P. Dale, <a href="/A172209/b172209.txt">Table of n, a(n) for n = 1..1000</a>

%e a(1)=1 because 18*1-5=13 is prime and 18*1+5=23 is prime.

%t Select[Range[400],AllTrue[18#+{5,-5},PrimeQ]&] (* _Harvey P. Dale_, Feb 25 2022 *)

%o (Magma) [n: n in [1..2500]|IsPrime(18*n-5) and IsPrime(18*n+5)] // _Vincenzo Librandi_, Dec 19 2010

%o (PARI) forprime(p=2,1e4,if(p%18==5 & isprime(p-10), print1(p\18", "))) \\ _Charles R Greathouse IV_, May 25 2011

%Y Cf. A000040, A172147, A172154.

%K nonn,easy

%O 1,2

%A _Juri-Stepan Gerasimov_, Jan 29 2010

%E Definition corrected and 49 inserted by _R. J. Mathar_ and _D. S. McNeil_, May 22 2010

%E Corrected by _D. S. McNeil_, May 22 2010