Hi

I am trying to develop a program to find primes with n digits abc such that acb 
bac bca cab and cba are also primes. (obviously trivial if aaa is prime!).

An example with n=3 is

1 p: 199 919 991

1 1 1

These primes are thin on the ground since they cannot contain any of the digits 
2 4 5 6 8 or 0 and I am wondering if it would be best to construct numbers 
omitting those containing those prohibited digits, or test every comination of 
p: i. n which seems wasteful, especially since I want to find all such primes 
below one million.

Can anyone see an efficent way to produce this?

Thanks in advance,

Richard
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to