OFFSET
1,1
COMMENTS
Since there are primes in the sequence, and concat(p,p) = p*(10^x+1) is always composite, it is clear that here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
n=333 -> previous prime is 331, thus '331333' is a prime.
MATHEMATICA
coQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{NextPrime[n, -1], n}]]]]; Select[Range[3, 513], coQ[#]&] (* Jayanta Basu, May 30 2013 *)
Select[Range[2, 550], PrimeQ[NextPrime[#, -1]*10^IntegerLength[#]+#]&] (* Harvey P. Dale, Nov 22 2020 *)
PROG
(Python)
from sympy import isprime, prevprime
def aupto(m):
return [k for k in range(3, m+1) if isprime(int(str(prevprime(k))+str(k)))]
print(aupto(513)) # Michael S. Branicky, Mar 09 2021
(PARI) isok(n)=n>2 && isprime(fromdigits(concat(digits(precprime(n-1)), digits(n)))) \\ Andrew Howroyd, Aug 13 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Oct 15 1998
EXTENSIONS
Offset changed by Andrew Howroyd, Aug 13 2024
STATUS
approved