cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A175789 Primes that become another prime under the map 8 <-> 9 (acting on the decimal digits).

This page as a plain text file.
%I A175789 #27 Feb 11 2013 19:34:41
%S A175789 181,191,283,293,787,797,811,853,877,881,887,911,953,977,991,997,1087,
%T A175789 1097,1483,1493,1801,1831,1873,1901,1931,1973,2287,2297,2383,2393,
%U A175789 2683,2693,2803,2857,2903,2957,3181,3191,3583,3593,3823,3847,3923,3947,4483
%N A175789 Primes that become another prime under the map 8 <-> 9 (acting on the decimal digits).
%H A175789 Robert Israel, <a href="/A175789/b175789.txt">Table of n, a(n) for n = 1..10000</a>
%e A175789 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.
%e A175789 383 is not in the sequence because changing the 8 to a 9 it becomes 393, which is thrice 131.
%p A175789 N:= 1000000: # to get all entries <= N
%p A175789 F:= proc(n) local L,R,i;
%p A175789   if not isprime(n) then return false end if;
%p A175789   L:= convert(n,base,10);
%p A175789   R:= subs([8=9,9=8],L);
%p A175789   if R = L then return false end if;
%p A175789   isprime(add(R[i]*10^(i-1),i=1..nops(R)))
%p A175789 end proc:
%p A175789 select(F, [seq(2*i+1,i=1..floor((N-1)/2))]);
%p A175789 # _Robert Israel_, Feb 11 2013
%t A175789 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 *)
%t A175789 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 *)
%o A175789 (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
%Y A175789 Cf. A171057.
%K A175789 base,nonn
%O A175789 1,1
%A A175789 _Zak Seidov_, Sep 05 2010