12065 - Permutation Primes

All about problems in Volume 120. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
New poster
Posts: 2
Joined: Thu Mar 26, 2009 5:53 pm

12065 - Permutation Primes

Post by groovyfeng »

Solution is straight-forward: prime enumeration + permutation generation, but needs to be very careful on the wording of the problem:
1. It says |p-q|<=1000, which means that a pair (p,q), where p>q, is a legitimate input.
2. It defines a permutation prime as a number whose difference with one or more of its permutations is of the form 9p, where p is a prime less than 1111111. It implies that if p is >= 1111111, then the number is not a permutation prime, which sounds a bit strange (although it simplifies the problem a little).

Post Reply

Return to “Volume 120 (12000-12099)”