OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..1008
EXAMPLE
89 is prime and appears in the sequence: 89 in binary = 1011001 and in octal = 131, which are also prime when read in decimal.
MAPLE
KD := proc() local a, b, d; a:=ithprime(n); b:=convert(a, binary); d:=convert(a, octal); if isprime(b) and isprime(d) then RETURN (a) ; fi; end: seq(KD(), n=1..50);
MATHEMATICA
t = {}; n = 1; While[Length[t] < 50, n = NextPrime[n]; If[PrimeQ[FromDigits[IntegerDigits[n, 8]]] && PrimeQ[FromDigits[IntegerDigits[n, 2]]], AppendTo[t, n]]]; t (* T. D. Noe, Jan 26 2014 *)
Select[Prime[Range[1400]], AllTrue[FromDigits/@{IntegerDigits[ #, 2], IntegerDigits[ #, 8]}, PrimeQ]&](* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 30 2018 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Jan 23 2014
STATUS
approved