OFFSET
1,1
COMMENTS
Prefixing by 0 gives the number itself, implying that a(n) is not prime.
Disjoint union of A124666 and (intersection of A065502 and A032352). - Reinhard Zumkeller, Oct 22 2011; edited by Michel Marcus, Aug 02 2022
All integers of the form 100*(21*n)^3 belong to the sequence, so it is infinite. - Mauro Fiorentini, Jan 05 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
If you prefix 20 with any digit you will get an even number. Also 201, 203, 207 and 209 are all composite.
MATHEMATICA
okQ[n_]:=If[EvenQ[n]||Divisible[n, 5], Union[PrimeQ[10 n+{1, 3, 7, 9}]] == {False}, !PrimeQ[n]&&Union[PrimeQ[10 n+{1, 3, 7, 9}]]=={False} && Union[ PrimeQ[Table[FromDigits[Join[{i}, IntegerDigits[n]]], {i, 9}]]] == {False}]; Select[Range[500], okQ] (* Harvey P. Dale, Jul 15 2011 *)
PROG
(PARI) is(n)=my(N=10*n, D=10^#Str(n)); forstep(k=n, n+9*D, D, if(isprime(k), return(0))); !(isprime(N+1)||isprime(N+3)||isprime(N+7)||isprime(N+9)) \\ Charles R Greathouse IV, Jul 15 2011
(Python)
from sympy import isprime
def ok(n):
s = str(n)
if any(isprime(int(s+c)) for c in "1379"): return False
return not any(isprime(int(c+s)) for c in "0123456789")
print([k for k in range(419) if ok(k)]) # Michael S. Branicky, Aug 01 2022
KEYWORD
base,nonn
AUTHOR
Tanya Khovanova, Dec 23 2006
EXTENSIONS
Deleted incorrect Haskell program. - N. J. A. Sloane, Aug 02 2022
STATUS
approved