def main(): gen = gmath.gen_sieve_of_eratosthenes() p, primes = 1, [] while p < 10000: p = gen.next() p2 = p + 3330 p3 = p + 6660 if gmath.is_prime(p2) and gmath.is_prime(p3): if gmath.is_permutation(p, p2) and gmath.is_permutation(p, p3): primes.append([str(p), str(p2), str(p3)]) return int(''.join(primes[1]))
def main(): for n in xrange(1, 300000): is_perm = True for i in range(1,7): if gmath.is_permutation(n, n*i) == False: is_perm = False break if is_perm: return n