Problems & Puzzles: Puzzles

Puzzle 704 Find a prime such that...

Let P be a prime number satisfying these two conditions:
  • P contains at least once all the integers from 0 to 9.
  • If you substitute -once at a time- all the occurrences for each digit in P by certain predefined integer Z equal to 1, 3, 7 or 9, you get a prime number each of the ten times.

Here is an incomplete example for a prime P of ten digits being distinct only eight of them and lacking of the digits 4 & 9, and let Z=3.

P=1081756237, 10 digits only 8 distinct. Z=3

Eight primes produced:
3083756237 1381756237 1031756237 1081356233 1081736237 1081753237 1081756337 1081756237.

Q1. Find the smallest P (but containing at least once all the integers from 0 to 9) for Z=3
Q2. Redo Q1 for Z=1, 7 & 9.
Q3. Send your largest example for each Z value.

Contributions came from Giovanni Resta


Resta wrote:

Q1 & Q2. The smallest primes with the requested property are:

Z  P
1  12672834505987
3  21187095634477
7  179504288526583
9  10832245527869

To search for these numbers, I've considered only the
sets of digits that do not lead to a multiple of 3 when
the substitutions d-> Z are performed.

For example, for Z=3, let me consider the multiset {0,..9} U {1}
that is the numbers which contains all the digits once, except the '1',
which appears twice. The sum, modulo 3, is 1, so it is possible that
numbers made with these digits are prime, like 123014506789.

However, the additional digit {1} is not compatible with Z=3, because
when, for example, the digit 4 is changed into 3 the resulting multiset
has sum 0 modulo 3 and thus cannot be a prime.

Proceeding in this way, it is easy to see that for Z=3 it is not possible add 1, 2 or 3 digits to the required 10 digits.
It is possible to add 4 digits, namely each one of the multisets
{1, 1, 4, 7}, {1, 4, 4, 7}, {1, 4, 7, 7}, {2, 2, 5, 8}, {2, 5, 5, 8},
or {2, 5, 8, 8}.

For each of these I considered all the permutations and
for {1,4,7,7} I found two primes, 21187095634477 and 63854027711479 with the required property.

For Z=7 the legitimate sets of 4 digits additions {1, 2, 5, 8} and
{2, 4, 5, 8} did not lead to a solution, so I had to check for numbers with 15 digits.

[Is it possible to exist an integer solution for this puzzle for two or
more disticnt Z values?, CR]

In theory a set of digits that is good for Z=3 can be good for Z=9
and the same holds for Z=1 and Z=7, but the solutions are so scarce that
its seems me hard to find one for two Z values.

Q3. I started searching for larger solutions only this afternoon.

In these few hours, the largest prime I was able to found is
P = 1056208858880824379 (19 digits) for Z=3.


Records   |  Conjectures  |  Problems  |  Puzzles