login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A124665 Numbers that cannot be either prefixed or followed by one digit to form a prime. 3
20, 32, 62, 84, 114, 126, 134, 135, 146, 150, 164, 168, 176, 185, 192, 196, 204, 210, 218, 232, 236, 240, 248, 256, 258, 282, 294, 298, 305, 314, 315, 324, 326, 328, 342, 348, 350, 356, 366, 368, 374, 375, 378, 395, 406, 408, 410, 414, 416, 418 (list; graph; refs; listen; history; internal format)
OFFSET

1,1

COMMENTS

Prefixing by 0 gives you the number itself. This way it is implicitly assumed that a(n) is not prime.

Intersection of A065502 and A032352. [Reinhard Zumkeller, Oct 22 2011]

LINKS

Reinhard Zumkeller, 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] (* From Harvey P. Dale, Jul 15 2011 *)

PROG

(PARI) a(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

(Haskell)

a124665 n = a124665_list !! (n-1)

a124665_list = filter

   (\x -> all (== 0) $ map (a010051 . (10*x +)) [1..9]) a065502_list

-- Reinhard Zumkeller, Oct 22 2011

CROSSREFS

The sequence A032737 = a(n) cannot be prefixed or followed by any digit to form a prime - allows you to prefix and postfix at the same time.

Cf. A010051.

Sequence in context: A075035 A032352 A183048 * A134989 A119873 A075230

Adjacent sequences:  A124662 A124663 A124664 * A124666 A124667 A124668

KEYWORD

base,nonn

AUTHOR

Tanya Khovanova (tanyakh(AT)yahoo.com), Dec 23 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 13 09:25 EST 2012. Contains 205451 sequences.