OFFSET
1,1
COMMENTS
See A090713 for a similar sequence whose definition works "in the opposite direction".
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The decimal representation of prime 23, considered as a number written in base 17, stands for 2*17+3 = 37, which is also prime, therefore 23 is in the sequence.
MAPLE
filter:= proc(p) local L;
if not isprime(p) then return false fi;
L:= convert(p, base, 10);
isprime(add(L[i]*17^(i-1), i=1..nops(L)))
end proc:
select(filter, [2, seq(i, i=3..10000, 2)]); # Robert Israel, Apr 25 2017
MATHEMATICA
Select[Prime@ Range@ 300, PrimeQ@ FromDigits[IntegerDigits@ #, 17] &] (* Michael De Vlieger, Jan 03 2016 *)
PROG
(PARI) is(p, b=17)={my(d=digits(p)); isprime(vector(#d, i, b^(#d-i))*d~)&&isprime(p)} \\ This code allows the production of similar sequences for other bases b > 9 (which can be given as an optional 2nd argument), but does not do the required check for bases b < 10.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jan 03 2014
STATUS
approved