5
$\begingroup$

I am trying to create a puzzle using the prime numbers (from 1 to 50): $2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47$ . No repeats allowed.

I want it to look like this:

http://oi63.tinypic.com/2wgvp60.jpg

The other operations can be filled in any way (either + or -). Just to clarify the totals must also be primes from the list.

If it helps, the 2 can be positioned somewhere else.

I have tried for several hours but I can't make one without using repeats or non primes.

If not possible, is it possible to make one using primes from 1-100 instead?

$\endgroup$
5
  • $\begingroup$ Can you say anything about why you have the particular constraints you do? E.g., why multiplications rather than +/- in those two places? $\endgroup$
    – Gareth McCaughan
    Commented Jan 11, 2018 at 23:02
  • $\begingroup$ I was making this puzzle so that BIDMAS would have been be used somewhere. And the only number this can apply with is the 2. I chose one to be before the 2 and one after. $\endgroup$
    – Bob
    Commented Jan 11, 2018 at 23:03
  • $\begingroup$ Only the numbers in the boxes need to be prime right? And not the ones outside the box? $\endgroup$
    – user44233
    Commented Jan 12, 2018 at 4:39
  • $\begingroup$ "The other operations can be filled in any way (either + or -)"; so the other operations are not multiplication? $\endgroup$ Commented Jan 12, 2018 at 20:50
  • $\begingroup$ The accepted answer does not have the '2' or operations listed in the image. If these are not required, please edit your question to make this clear. ('other operations' -> 'operations', etc.) $\endgroup$ Commented Jan 13, 2018 at 2:35

2 Answers 2

7
$\begingroup$
2  +  3 * 5  = 17
*     +   +
7  + 47 - 11 = 43
+     -   +
23 + 31 - 13 = 41
=     =   =
37   19   29



2  + 3  *  5 = 17
*    +     +
7  + 47 - 13 = 41
+    -     +
23 + 31 - 11 = 43
=    =    =
37   19   29
$\endgroup$
3
  • $\begingroup$ Thank you. How did you find these? Trial and error or did you use some sort of program/code? $\endgroup$
    – Bob
    Commented Jan 12, 2018 at 17:09
  • $\begingroup$ I think it almost impossible to find it by hand, because there is no math formula to find it easily, so I use Haskell to find the solution. $\endgroup$ Commented Jan 13, 2018 at 3:00
  • $\begingroup$ Which numbers should I include so that the puzzle is possible to solve without guessing? I was thinking the 3, 17, 23 and 19 - any more? $\endgroup$
    – Bob
    Commented Jan 14, 2018 at 1:27
1
$\begingroup$
 2 *  3 + 37 = 43
 *    +    -
 5 -  7 + 19 = 17
 +    +    +
13 - 31 + 29 = 11
 =    =    =
23   41   47

 2 *  3 + 37 = 43
 *    +    -
 5 - 41 + 47 = 11
 +    -    +
 7 - 13 + 29 = 23
 =    =    =
17   31   19

 2 *  3 + 37 = 43
 *    +    -
 5 - 41 + 47 = 11
 +    -    +
19 - 13 + 17 = 23
 =    =    =
29   31    7

etc.

These were generated with a python script available here (press run).

$\endgroup$
6
  • $\begingroup$ How can I change the code so that I can find puzzles with more than one solution? What I mean is if I have a grid with the operations fixed then there's two possible answers e.g. the accepted answer. $\endgroup$
    – Bob
    Commented Jan 14, 2018 at 2:05
  • $\begingroup$ @Bob Here is a (probably rather inefficient) version of the script that generates filled-in squares, then find other numerical solutions with the same operations. Groups of same-operation-squares are preceded by the list of operators they use (horizontal right-down, then vertical down-right order). $\endgroup$ Commented Jan 14, 2018 at 3:40
  • $\begingroup$ Thanks. I ran the code for a while and saw it repeating some solutions. Can this be fixed? $\endgroup$
    – Bob
    Commented Jan 14, 2018 at 14:30
  • $\begingroup$ @Bob I updated the link in my other comment $\endgroup$ Commented Jan 14, 2018 at 20:39
  • $\begingroup$ I get the following error: Traceback (most recent call last): File "python", line 15 O,P,Q,R,S,T,U,V,W,X,Y,Z = op_list ^ TabError: inconsistent use of tabs and spaces in indentation $\endgroup$
    – Bob
    Commented Jan 14, 2018 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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