login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A217045 Primes that remain prime when a single "4" digit is inserted between any two adjacent decimal digits. 4
19, 37, 43, 61, 67, 73, 97, 109, 199, 211, 223, 241, 349, 409, 421, 457, 463, 541, 571, 751, 757, 823, 991, 1033, 1087, 1321, 1423, 1447, 1543, 2749, 3361, 3469, 3499, 3847, 4111, 4273, 4483, 5059, 5437, 5443, 5449, 6373, 6709, 6793, 7687, 8089, 8221, 8443 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
87697 is prime and also 876947, 876497, 874697 and 847697.
MAPLE
with(numtheory);
A217045:=proc(q, x)
local a, b, c, i, n, ok;
for n from 5 to q do
a:=ithprime(n); b:=0;
while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
for i from 1 to b-1 do
c:=a+9*10^i*trunc(a/10^i)+10^i*x;
if not isprime(c) then ok:=0; break; fi; od;
if ok=1 then print(ithprime(n)); fi;
od; end:
A217045(100000, 4)
MATHEMATICA
Select[Prime[Range[5, 1500]], AllTrue[Table[FromDigits[Insert[ IntegerDigits[ #], 4, n]], {n, 2, IntegerLength[#]}], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 04 2017 *)
PROG
(PARI) is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=4; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012
CROSSREFS
Sequence in context: A354431 A059695 A134196 * A139313 A272205 A347371
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Sep 25 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)