cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A215419 Primes that remain prime when a single digit 3 is inserted between any two consecutive digits or as the leading or trailing digit.

This page as a plain text file.
%I A215419 #27 Nov 25 2024 19:28:25
%S A215419 7,11,17,31,37,73,271,331,359,373,673,733,1033,2297,3119,3461,3923,
%T A215419 5323,5381,5419,6073,6353,9103,9887,18289,23549,25349,31333,32933,
%U A215419 33349,35747,37339,37361,37489,47533,84299,92333,93241,95093,98491,133733,136333,139333
%N A215419 Primes that remain prime when a single digit 3 is inserted between any two consecutive digits or as the leading or trailing digit.
%H A215419 Robert Israel, <a href="/A215419/b215419.txt">Table of n, a(n) for n = 1..150</a>
%e A215419 18289 is prime and also 182893, 182839, 182389, 183289, 138289, 318289.
%p A215419 filter:= proc(n) local L,d,k,M;
%p A215419 if not isprime(n) then return false fi;
%p A215419 L:= convert(n,base,10);
%p A215419 d:= nops(L);
%p A215419 for k from 0 to d do
%p A215419    M:= [seq(L[i],i=1..k),3,seq(L[i],i=k+1..d)];
%p A215419    if not isprime(add(M[i]*10^(i-1),i=1..d+1)) then return false fi;
%p A215419 od;
%p A215419 true
%p A215419 end proc;
%p A215419 select(filter, [seq(i,i=3..2*10^5,2)]); # _Robert Israel_, Oct 09 2017
%t A215419 ins@n_:=Insert[IntegerDigits@n,3,#]&/@Range@(IntegerLength@n+1);
%t A215419 Cases[{#,FromDigits@#&/@ins@#}&/@ Cases[Range[11,70000],_?PrimeQ], {_,{_?PrimeQ..}}][[All,1]] (* _Hans Rudolf Widmer_, Dec 21 2023 *)
%Y A215419 Cf. A215417, A069246, A215420, A215421
%K A215419 nonn,base
%O A215419 1,1
%A A215419 _Paolo P. Lava_, Aug 10 2012