Problems & Puzzles: Puzzles

Puzzle 63.- Another (3rd) Mike Keith's little puzzle.

Take an n-digit integer and construct all the possible expressions you can that use the individual digits of the number combined with parentheses and the operators +, -, *, and /. (Note: just to be clear, because people sometimes get confused with this kind of problem, NO other operators are allowed - no exponentiation, no concatenation of digits, nothing.)

If you calculate the values of these expressions, some will be non-integers, some will be negative, etc, but just take those that are (positive) prime numbers. Then find which range of consecutive primes starting with 2 is included in the set. Call the last prime in the range P(n).

Now...define a(n) as the largest value of P(n) for any n-digit integer. What are the values of a(n), and which primes produce them?

Here are the answers for the first few n. Note that without loss of generality, we can examine just n-digit integers whose digits in order are non-decreasing. So that's the way I've listed them below.

n=2: 12, 13, or 36 generate 2...3; so a(n) = 36
n=3: a(n) = 237 generates 2...23
n=4: a(n) = 3579 generates 2...71
n=5: a(n) = 45679 gives 2...317
n=6: a(n) = 567889 gives 2…1033

Here is n = 3 in detail:

2 = 7-3-2
3 = (7+2)/3
5 = (7+3)/2
7 = 7*(3-2)
11 = 2*7 - 3
13 = 2*3 + 7
17 = 2*7 + 3
19 = 7*3 - 2
23 = 7*3 + 2

a) Can you obtain the details for n = 4, 5 & 6

b) Can you calculate a(n) for n= 7, 8 & 9?


Solution

Jim R. Howell sent (10/07/99) the details for n = 4 (calculated 'by hand'):
2  = (7+9)/(3+5); 3  = (9-3)/(7-5); 5  = 5*(3+7-9); 7  = 7*(9-5-3); 11 = (7+3)/5+9; 13 = 5*3+7-9; 17 = 5*3+9-7; 19 = (9-5)*3+7; 23 = 7*5-3-9; 29 = 7*5+3-9; 31 = 5*3+7+9; 37 = (9-3)*5+7; 41 = 7*5+9-3; 43 = (9+7)*3-5; 47 = 7*5+3+9; 53 = (9+3)*5-7; 59 = (7+3)*5+9; 61 = 9*7+3-5; 67 = (9+3)*5+7
71 = 9*7+5+3.


Records   |  Conjectures  |  Problems  |  Puzzles