login

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

Numbers n such that 10n01 is a prime.
3

%I #11 Mar 16 2017 22:13:39

%S 3,5,6,15,17,20,21,23,27,30,38,47,48,54,56,57,65,68,71,72,83,84,90,92,

%T 102,105,110,116,122,126,134,135,143,155,156,162,164,173,182,183,197,

%U 198,200,201,203,204,210,213,222,225,227,231,233,236,249,261,264,270,281,282,290

%N Numbers n such that 10n01 is a prime.

%H Robert Israel, <a href="/A099678/b099678.txt">Table of n, a(n) for n = 1..10000</a>

%p t0:=[]; u0:=[]; for n from 0 to 500 do p0:="10"; p1:="01"; t1:=cat(p0,n,p1); t1:=convert(t1,decimal,10); if isprime(t1) then t0:=[op(t0),n]; u0:=[op(u0),t1]; fi; od: t0;

%p # Alternative:

%p filter:= n -> isprime( 10^(ilog10(n)+4)+100*n+1):

%p select(filter, [$1..1000]); # _Robert Israel_, Mar 16 2017

%t Select[ Range[280], PrimeQ[ FromDigits[Join[{1, 0}, IntegerDigits[ # ], {0, 1}]]] &] (* _Robert G. Wilson v_, Nov 20 2004 *)

%o (PARI) isok(n) = isprime(eval(concat(concat("10", n), "01"))); \\ _Michel Marcus_, Jul 29 2015

%Y Cf. A032672, A100502 (for the primes).

%K nonn,base

%O 1,1

%A _N. J. A. Sloane_, Nov 19 2004