15
$\begingroup$

This question is inspired by the Prime to Prime puzzle.

The first 24 Prime Numbers are

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89

Using up to 4 prime numbers and the following mathematical operations, get all 24 primes.

+ - × /

No other operators are allowed (note the added restrictions from the previous question).

Other rules

  • You cannot use same prime number more than once in any equation.
  • You can use only prime numbers.
  • You do not have to use all the 4 primes in every equation.
  • You must use the same set of 4 primes in every equation. If you select say 2, 13, 17, 23 then they are the only primes that to appear in every equation to get the 24 primes.
  • Concatenation is forbidden.
  • Parentheses are permitted.

Please refrain from posting partial solutions as there are many sets of primes which will not work.

$\endgroup$
10
  • $\begingroup$ I will be really surprised if there is valid answer exists in this condition. $\endgroup$
    – Oray
    Commented Dec 11, 2019 at 12:29
  • 2
    $\begingroup$ @Oray according to Peter Taylor's comment on the previous puzzle, there is one unique solution $\endgroup$
    – DrD
    Commented Dec 11, 2019 at 12:40
  • 1
    $\begingroup$ @hexomino have you excluded ^ intentionally? $\endgroup$
    – DrD
    Commented Dec 11, 2019 at 12:47
  • 1
    $\begingroup$ @DEEM Yes, ^ is excluded. $\endgroup$
    – hexomino
    Commented Dec 11, 2019 at 12:48
  • 2
    $\begingroup$ @athin I have decided to allow computers for this one, but if somebody comes up with a non-computer solution, that would be very interesting and impressive. $\endgroup$
    – hexomino
    Commented Dec 11, 2019 at 14:16

2 Answers 2

12
$\begingroup$

Here is the answer:

$2=2$

$3=3$

$5=2+3$

$7=\frac{43-3}{2}-13$

$11=43-2\cdot(13+3)$

$13=13$

$17=43-13\cdot2$

$19=13+3\cdot2$

$23=43-2\cdot(13-3)$

$29=43-13-3+2$

$31=43-13+3-2$

$37=43-3\cdot2$

$41=\frac{43+3\cdot13}{2}$

$43=43$

$47=2\cdot43-3\cdot13$

$53=43+13-3$

$59=43+13+3$

$61=43+13+3+2$

$67=2\cdot(43-3)-13$

$71=\frac{3\cdot43+13}{2}$

$73=2\cdot43-13$

$79=2\cdot(43+3)-13$

$83=2\cdot43-3$

$89=2\cdot43+3$

$\endgroup$
1
  • 1
    $\begingroup$ Great work! As far as I can tell, there is only one other set that works. $\endgroup$
    – hexomino
    Commented Dec 12, 2019 at 10:12
4
$\begingroup$

Computer confirms that the only other solution is:

$$\begin{align*}2 &= 2 \\3 &= 3 \\5 &= (2 + 3) \\7 &= - ((3 - 17) / 2) \\11 &= (17 - (2 \cdot 3)) \\13 &= ((17 + 61) / (2 \cdot 3)) \\17 &= 17 \\19 &= (2 + 17) \\23 &= (17 + (2 \cdot 3)) \\29 &= - ((3 - 61) / 2) \\31 &= - (3 - (2 \cdot 17)) \\37 &= (3 + (2 \cdot 17)) \\41 &= (61 - (3 + 17)) \\43 &= ((2 - 3) - (17 - 61)) \\47 &= (61 + (3- 17)) \\53 &= (2 + (3 \cdot 17)) \\59 &= - (2 - 61) \\61 &= 61 \\67 &= (61 + (2 \cdot 3)) \\71 &= ((2 \cdot 61) - (3 \cdot 17)) \\73 &= - ((2 + 3) - (17 + 61)) \\79 &= - ((2 - 3) - (17 + 61)) \\83 &= ((2 + 3) + (17 + 61)) \\89 &= (61 - (2 \cdot (3 - 17)))\end{align*}$$

$\endgroup$
6
  • $\begingroup$ Sorry, lemme get the other one $\endgroup$
    – Sny
    Commented Jan 31 at 12:24
  • $\begingroup$ @hexomino done. $\endgroup$
    – Sny
    Commented Jan 31 at 12:26
  • $\begingroup$ Yes, very good, this was the other set I had found, +1 (P.S. some of your expressions need a little adjustment as they seem to give the negative value, e.g, 7) $\endgroup$
    – hexomino
    Commented Jan 31 at 16:13
  • $\begingroup$ Whoops, I used ~ for negative signs... $\endgroup$
    – Sny
    Commented Feb 1 at 2:21
  • 1
    $\begingroup$ ^ Help me optimize my program? My program iterates through each ordered pair of numbers, and iterates through each operation, and iterates through possible negations in that order. Therefore, since $(2,61)$ comes before $(61,2)$, my program outputs $-(2-61)$. $\endgroup$
    – Sny
    Commented Feb 1 at 6:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.