login
Numbers such that Sum_{i<j, i,j =1..r} d(i)*d(j) is a prime number, where the d(i) are digits of n (n = concatenation of d(1), ..., d(r)).
1

%I #12 Mar 30 2012 18:35:54

%S 12,13,15,17,21,31,51,71,102,103,105,107,111,112,113,115,116,118,119,

%T 120,121,123,125,127,129,130,131,132,134,135,137,143,145,150,151,152,

%U 153,154,156,157,158,159,161,165,170,172,173,175,178,179,181,185,187,189,191,192,195,197,198,201,210,211,213,215,217,219,231,235,237,251,253,257

%N Numbers such that Sum_{i<j, i,j =1..r} d(i)*d(j) is a prime number, where the d(i) are digits of n (n = concatenation of d(1), ..., d(r)).

%e 253 is in the sequence because d(1)*d(2) + d(1)*d(3) + d(2)*d(3) = 2*5+2*3+5*3 = 31 is prime.

%p with(numtheory):T:=array(1..10):k:=1:for n from 1 to 1000 do:l:=length(n):n0:=n:for

%p m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :T[m]:=u:od: s:=0:

%p for i from 1 to l-1 do: for j from i+1 to l do: s:=s+T[i]*T[j]:od: od:if type(s,prime)

%p = true then printf(`%d, `,n):else fi:od:

%Y Cf. A187559.

%K nonn,base,easy

%O 1,1

%A _Michel Lagneau_, Mar 11 2011