OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
283 is in the sequence because changing the 8 to a 9 it becomes 293, a different prime. Likewise 293 is also in the sequence.
383 is not in the sequence because changing the 8 to a 9 it becomes 393, which is thrice 131.
MAPLE
N:= 1000000: # to get all entries <= N
F:= proc(n) local L, R, i;
if not isprime(n) then return false end if;
L:= convert(n, base, 10);
R:= subs([8=9, 9=8], L);
if R = L then return false end if;
isprime(add(R[i]*10^(i-1), i=1..nops(R)))
end proc:
select(F, [seq(2*i+1, i=1..floor((N-1)/2))]);
# Robert Israel, Feb 11 2013
MATHEMATICA
Reap[Do[p = Prime[n]; id = IntegerDigits[p]; id2 = id /. {9 -> 8, 8 -> 9}; If[PrimeQ[fd = FromDigits[id2]]&& fd != p, Sow[p]], {n, 2000}]][[2, 1]]; (* Seidov, corrected by Wouter Meeussen, Feb 10 2013 *)
fQ[n_] := Block[{id = IntegerDigits@n}, (MemberQ[id, 8] || MemberQ[id, 9]) && PrimeQ[ FromDigits[id /. {8 -> 9, 9 -> 8}] ]]; Select[ Prime@ Range@ 609, fQ] (* Robert G. Wilson v, Sep 06 2010 *)
PROG
(PARI) is_A175789(n)={my(d=digits(n)); d != (d=apply(t->bitxor(t, t>7), d)) & isprime( sum(i=1, #d, d[i]*10^(#d-i))) & isprime(n)} \\ - M. F. Hasler, Feb 11 2013
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov, Sep 05 2010
STATUS
approved