I recently worked on problem 51 through project euler, I solved it essentially through brute-force but afterwards I viewed the forum and there were some more clever solutions.
For those unfamiliar with project euler, the problem reads:
By replacing the 1st digit of *3, it turns out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.
By replacing the 3rd and 4th digits of 56**3 with the same digit, this 5-digit number is the first example having seven primes among the ten generated numbers, yielding the family: 56003, 56113, 56333, 56443, 56663, 56773, and 56993. Consequently 56003, being the first member of this family, is the smallest prime with this property.
Find the smallest prime which, by replacing part of the number (not necessarily adjacent digits) with the same digit, is part of an eight prime value family.
People were able to drastically cut down the run times of their program with some shortcuts. First, they only replaced repeated digits in the prime numbers, where as I replaced all digits. They also determined that they need not consider primes with 2 or 4 repeated digits, as these would produce composite numbers at some point. I am curious of the mathematical reasoning behind these shortcuts, and any theories to back it up. The only one I could glean from the thread was that if the sum of the digits in the number is divisible by 3, the number itself will also be divisible by 3, but I don't see how that relates to the shortcuts they used.