login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes p for which none of the concatenations p3, p9, 3p, 9p are primes.
1

%I #31 Sep 06 2020 13:08:23

%S 3,107,113,179,317,443,487,599,641,653,751,773,937,977,991,1021,1087,

%T 1103,1187,1201,1213,1217,1301,1409,1427,1439,1483,1553,1559,1579,

%U 1609,1637,1693,1747,1777,1787,1789,1861,1949,1987,1993,2081,2129,2239,2281,2287,2293,2351,2393,2477

%N Primes p for which none of the concatenations p3, p9, 3p, 9p are primes.

%H Harvey P. Dale, <a href="/A245657/b245657.txt">Table of n, a(n) for n = 1..10000</a>

%t Select[Prime[Range[400]],NoneTrue[{10#+3,10#+9,3*10^IntegerLength[#]+#, 9*10^IntegerLength[ #]+#},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 06 2020 *)

%o (PARI) lista(nn) = {forprime(p=2, nn, if (!isprime(eval(concat(Str(p), Str(3)))) && ! isprime(eval(concat(Str(p), Str(9)))) && ! isprime(eval(concat(Str(3), Str(p)))) && ! isprime(eval(concat(Str(9), Str(p)))), print1(p, ", ")););} \\ _Michel Marcus_, Sep 14 2014

%o (Python)

%o import sympy

%o from sympy import isprime

%o from sympy import prime

%o for n in range(1,10**3):

%o ..p = str(prime(n))

%o ..if not isprime(p+'3') and not isprime(p+'9') and not isprime('3'+p) and not isprime('9'+p):

%o ....print(int(p),end=', ') # _Derek Orr_, Sep 16 2014

%Y Cf. A232210, A242775, A247341, A247342.

%K nonn,base,easy

%O 1,1

%A _Vladimir Shevelev_, Sep 13 2014

%E More terms from _Derek Orr_, Sep 16 2014