A228629 Members p of a pair of primes (p,q) such that the decimal digits of q are the 9's complement of the decimal digits of p.
2, 7, 23, 61, 67, 83, 107, 109, 127, 163, 167, 181, 211, 223, 227, 239, 241, 251, 263, 269, 271, 277, 283, 293, 307, 367, 383, 389, 401, 409, 421, 461, 463, 467, 487, 509, 521, 523, 563, 587, 601, 607, 613, 617, 631, 641, 643, 647, 653, 661, 673, 677, 683, 701
Offset: 1
Examples
23 is in the sequence because 9-2 = 7 and 9 - 3 = 6 => 67 is prime, and we obtain the pair (23, 67).
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A228628.
Programs
-
Maple
with(numtheory):kk:=0: for n from 1 to 200 do: ii:=0: for k from 1 to 2000 while(ii=0) do: p1:=ithprime(n):p2:=ithprime(k): x1:=convert(p1,base,10):n1:=nops(x1): x2:=convert(p2,base,10):n2:=nops(x2): if n1=n2 then W:=array(1..n1):U:=array(1..n1):U1:=array(1..n1): for c from 1 to n1 do: U1[c]:=x1[c]:od:U:=sort(x1,`<`):V:=sort(x2,`>`): for j from 1 to n1 do: W[j]:= 9-V[j]:od:W1:=sort(W,`>`):jj:=0: for b from 1 to n1 do: if U[b]=W1[b] then jj:=jj+1: else fi: od: if jj=n1 then ii:=1: kk:=kk+1: printf(`%d, `,p1): else fi: fi: od: od: # Alternative: R:= 2,7: for d from 2 to 3 do P:= select(isprime,[seq(i,i=10^(d-1)+1..10^d-1,2)]); nP:= nops(P); Pd:= map(sort@convert,P,base,10); Ps:= convert(map(t -> ListTools:-Reverse([9$d]-t), Pd),set); S:= select(t -> member(Pd[t],Ps),[$1..nP]); R:= R, op(P[S]); od: R; # Robert Israel, Oct 06 2020
Comments