|
|
A185250
|
|
Array A(n,k), n > 0, k = 1,2 read by rows such that (A(n,1), A(n,2)) are the pairs of primes (p, q), p < q, where the decimal digits of q are the 9's complement of the decimal digits of p.
|
|
1
|
|
|
2, 7, 23, 67, 61, 83, 107, 829, 109, 809, 127, 827, 163, 683, 163, 863, 167, 283, 167, 823, 181, 881, 211, 887, 223, 677, 227, 277, 227, 727, 239, 607, 241, 587, 241, 857, 251, 487, 263, 367, 263, 673, 269, 307, 271, 827, 283, 617, 283, 761, 293, 607, 383, 661
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The prime p in the pair (p, q) is not unique; for example, the prime 163 generates two pairs of primes: (163, 683) and (163, 863).
|
|
LINKS
|
|
|
EXAMPLE
|
(241, 587) and (241, 857) are in the sequence because the digits 5, 8, 7 are the 9's complement of the decimal digits of 241.
|
|
MAPLE
|
with(numtheory):
for n from 1 to 200 do:
p1:=ithprime(n)
for k from n+1 to 2000 do:
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 and p1<p2
then
printf(`%d, `, p1):
printf(`%d, `, p2):else
fi:
fi:
od:
od:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,less
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|