login
Concatenation of 'prevprime(k) and k and prevprime(k)' is a prime.
1

%I #14 Aug 13 2024 22:53:52

%S 5,8,9,12,14,17,19,23,25,28,31,33,38,39,41,42,47,48,51,60,61,62,63,69,

%T 71,72,75,77,78,80,81,84,85,91,102,104,105,111,124,126,149,150,167,

%U 181,182,189,192,194,215,222,227,230,233,242,243,256,271,273,283,288,308

%N Concatenation of 'prevprime(k) and k and prevprime(k)' is a prime.

%H Andrew Howroyd, <a href="/A034812/b034812.txt">Table of n, a(n) for n = 1..10000</a>

%e n=222 -> previous prime is 211, thus '211222211' is a prime.

%t okQ[n_] := Module[{idppn=IntegerDigits[NextPrime[n,-1]]}, PrimeQ[FromDigits[Join[idppn, IntegerDigits[n], idppn]]]]; Select[Range[350], okQ] (* _Harvey P. Dale_, Jan 07 2011 *)

%o (PARI) isok(n)=my(x=digits(precprime(n-1))); n>2 && isprime(fromdigits(concat([x, digits(n), x]))) \\ _Andrew Howroyd_, Aug 13 2024

%Y Cf. A034808-A034821.

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Oct 15 1998

%E Offset changed by _Andrew Howroyd_, Aug 13 2024