OFFSET
1,1
COMMENTS
The sequence is finite. The last 10 terms are 98876342501, 98876405231, 98876421053, 98876502143, 98876504123, 98876520143, 98876524013, 98876524301, 98876530421, 98876532401. - Zak Seidov, Dec 18 2014
Number of n-digits terms starting with n=1: {0, 1, 46, 508, 4117, 31395, 187533, 854665, 2989094, 7172381, 6481542}. - Zak Seidov, Jun 04 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
G:= proc(d) # to produce all d-digit terms
local L, C, Cc, P, i, x, res;
res:= NULL;
L:= [false, true, false, true, false, false, false, true, false, true];
for C in combinat:-choose([$0..9], d-1) do
for i from 1 to d-1 do
Cc:= [op(C), C[i]];
if convert(Cc, `+`) mod 3 = 0 then next fi;
for P in combinat:-permute(Cc) do
if P[-1] = 0 or not L[P[1]+1] then next fi;
x:= add(P[i]*10^(i-1), i=1..nops(P));
if isprime(x) then res:= res, x fi;
od
od
od;
sort([res]);
end proc:
seq(op(G(d)), d=1..5); # Robert Israel, Jun 04 2015
MATHEMATICA
fQ[n_]:=Length[IntegerDigits[n]]-Length[Union[IntegerDigits[n]]]==1; Select[Prime@Range[21713], fQ[#]&] (* Ivan N. Ianakiev, Sep 25 2015 *)
PROG
(PARI) lista(nn) = {forprime(p=2, nn, my(d = digits(p)); if (#vecsort(d, , 8) == #d-1, print1(p, ", ")); ); } \\ Michel Marcus, Dec 18 2014
CROSSREFS
KEYWORD
nonn,fini,base
AUTHOR
Juri-Stepan Gerasimov, Jan 19 2009
EXTENSIONS
Definition clarified by R. J. Mathar, May 05 2010
STATUS
approved