login
A276481
Numbers n such that b(n) is a prime, where b(1) = prime(1) = 2, b(n) = 10*b(n-1) + (prime(n) mod 10).
0
1, 2, 4, 13, 16, 17, 28, 34, 90, 100, 132, 331, 534, 7923
OFFSET
1,2
COMMENTS
Primes in the sequence b(n) are 2, 23, 2357, 2357137939171, ...
MAPLE
Res:= NULL: p:= 0: b:= 0:
for n from 1 to 600 do
p:= nextprime(p);
b:= 10*b + (p mod 10);
if isprime(b) then Res:= Res, n fi
od:
Res; # Robert Israel, Sep 05 2016
MATHEMATICA
b[1] = Prime@ 1; b[n_] := b[n] = 10 b[n - 1] + Mod[Prime@ n, 10]; Select[Range[10^3], PrimeQ@ b[#] &] (* Michael De Vlieger, Sep 06 2016 *)
PROG
(PARI) b(n) = if (n==1, 2, 10*b(n-1) + (prime(n) % 10));
isok(n) = isprime(b(n)); \\ Michel Marcus, Sep 05 2016
(PARI) list(lim)=my(v=List(), s, n); forprime(p=2, , if(n++>lim, return(Vec(v))); if(ispseudoprime(s=10*s+p%10), listput(v, n))) \\ Charles R Greathouse IV, Sep 05 2016
CROSSREFS
Sequence in context: A373602 A024580 A074097 * A287684 A033628 A077319
KEYWORD
nonn,base
AUTHOR
Thomas Ordowski, Sep 05 2016
EXTENSIONS
a(7)-a(13) from Michel Marcus, Sep 05 2016
a(14) from Robert Israel, Sep 05 2016
STATUS
approved