# Prime to number conversion

This puzzle relates to Prime to Prime: Get all first 25 Prime Numbers using up to 4 Primes and its sequel Prime to Prime Sequel

Using any three of the first 4 prime numbers (2,3,5 and 7) and the folllowing math operations get the first 23 numbers (from 1 to 23).

x / + - ^ ! !! Square root

Other Rules

Once you select the three primes all the three primes must appear (once only) in every equation. Use of only 1 or 2 primes not permitted. All three primes must appear once only. ( e.g. 4=7-3 not allowed. it could be 4=2+7-5)

Same three primes must appear in every equation.

Any prime that appears anywhere in the equation is counted. If you used 3^2 then you have used up 2 and 3

Multiple roots not allowed ( Sq root of sq root)

Concatenation is forbidden.

Parentheses are permitted.

• All three primes must appear only once? But you've given us four primes... Commented May 4, 2020 at 14:41
• Yes. You can pick any three out of 4 . Those three must appear once in every equation. Say you use 2 , 3 and 5 then only those 3 must be used once in every equation.
– DrD
Commented May 4, 2020 at 15:17
• For multiple roots, does that disqualify taking the square root of a square? For example, could I do \sqrt{5^2} ?
– Herb
Commented May 4, 2020 at 16:40
• Yes it does @Herb Wolfe
– DrD
Commented May 4, 2020 at 17:42
• This is a fun puzzle (I got here a bit late unfortunately). I doubt that allowing multiple roots would create any additional solutions in this case, since rounding isn't allowed.
– user63779
Commented May 5, 2020 at 1:40

It might be more fun to fill the whole table. I've started with a few examples:

$$\require{begingroup}\begingroup \def\*{\times } \begin{array}{|c|c|c|c|c|} \hline n& 2,3,5 & 2,3,7 & 2,5,7 & 3,5,7 \\ \hline 1& 2\*3-5 & 7-2\*3 & \frac{2+5}{7} & 3+5-7 \\ 2& (3!-5)\*2 & 7-3-2 & \sqrt{(7-5)\*2} & \frac{3+7}5 \\ 3& (5-2)!-3 & \frac{7+2}{3} & 2\*5-7 & \sqrt{3^{7-5}} \\ 4& 2-3+5 & 2^{\sqrt{7-3}} & 2-5+7 & \frac{7+5}{3} \\ 5& (3-2)\*5 & \frac{7+3}{2} &\frac{7!!}{5!!}-2& 3-5+7 \\ 6& -2+3+5 & 2-3+7 & \frac{7+5}{2} & (7-5)\*3 \\ 7& 2\*5-3 & (3-2)\*7 & \sqrt{(2+5)\*7} & \sqrt{7^{5-3}} \\ 8& (\frac{3+5}{2})!! & -2+3+7 & 5+\sqrt{2+7} & 3\*5-7 \\ 9& (5-2)!+3 & (7-2)!!-3! & 2\*7-5 & -3+5+7 \\ 10& 2+3+5 & 7+\frac{3!}{2} & -2+5+7 & 5\*\sqrt{7-3} \\ 11& 2\*3+5 & 2\*7-3 & \frac{5!!+7}{2} & 5!!+3-7 \\ 12& (5-2)!+3! & 2+3+7 & \sqrt{(5+7)^2} & (7-5)\*3! \\ 13& 2\*5+3 & 2\*3+7 & (5-2)!+7 & {7!!\over5!!}+3!\\ 14& 3^2+5 & 2\*\frac{7!}{(3!)!} & 2+5+7 & (5-3)\*7 \\ 15& (3-2)\*5!! & (7-2)\*3 & 5\*\sqrt{2+7} & 3+5+7 \\ 16& (5+3)\*2 & 2^{(7-3)} & (5!!-7)\*2 & 3\*7-5 \\ 17& 3\*5+2 & 2\*7+3 & 2\*5+7 & 5!!+\sqrt{7-3} \\ 18& (5-2)!\*3 & (7-2)!!+3 & 5^2-7 & 3+5!-7!! \\ 19& 5!!+3!-2 & 3\*7-2 & 2\*7+5 & 5!!+7-3 \\ 20& 5!!+3+2 & 2\*(3+7) & 5!!+7-2 & (7-3)\*5 \\ 21& (5+2)\*3 & (7-2)!!+3! & 7\*(5-2) & 3*{7!!\over5!!} \\ 22& 5^2-3 & (7-3)!-2 & & 3\*5+7 \\ 23& 5!!+3!+2 & 3\*7+2 & 5!!\*2-7 & 5!!+(7-3)!! \\ \hline \end{array} \endgroup$$

• Wow. OK. I did that but for me it did not work with all combinations. Only one. May be you will have better approach
– DrD
Commented May 4, 2020 at 13:55
• 2, 3, 5 is done
– Herb
Commented May 4, 2020 at 17:19
• Of course, now that @David G. has generated a complete chart, the challenge for new entries here is to differ from that chart
– humn
Commented May 4, 2020 at 18:13
• 2, 3, 7 is complete now as well.
– Herb
Commented May 4, 2020 at 20:42
• @oAlt; I've fixed 257:2
– JMP
Commented May 5, 2020 at 3:59

I tried writing a generator. I can get everything from 1 to 24 inclusive, for all 4 combinations. I can get 0 to 33 for one combination. The first ungeneratable counting number is 68.

$$\begin{array}{|c|c|c|c|c|} \hline n& 2,3,5 & 2,3,7 & 2,5,7 & 3,5,7 \\ \hline 0 & (5-(2+3)) & (3-\sqrt{(2+7)}) & (7-(2+5)) & - \\ 1 & (\frac{5}{(2+3)}) & (7-(2\times3)) & (\frac{7}{(2+5)}) & ((3+5)-7) \\ 2 & \sqrt{(5+(2-3))} & (7-(2+3)) & \sqrt{(7+(2-5))} & (\frac{(3+7)}{5}) \\ 3 & ({2}^{3}-5) & (\frac{(2+7)}{3}) & ((2\times5)-7) & \sqrt{(7-(3-5))} \\ 4 & (5+(2-3)) & \sqrt{(7+{3}^{2})} & (7+(2-5)) & (\frac{(5+7)}{3}) \\ 5 & (5\times(3-2)) & (\frac{(3+7)}{2}) & \sqrt{({2}^{5}-7)} & (7+(3-5)) \\ 6 & (5-(2-3)) & (7+(2-3)) & (\frac{(5+7)}{2}) & (3\times(7-5)) \\ 7 & ((2\times5)-3) & (7\times(3-2)) & \sqrt{(7\times(2+5))} & (\frac{{7}!!}{(3\times5)}) \\ 8 & (\frac{{5}!}{{(2+3)}!!}) & (7-(2-3)) & {(7+(2-5))}!! & ((3\times5)-7) \\ 9 & (3\times(5-2)) & (3\times\sqrt{(2+7)}) & ((2\times7)-5) & (7-(3-5)) \\ 10 & (5+(2+3)) & \sqrt{({7}!!-(2+3))} & (7-(2-5)) & (5\times\sqrt{(7-3)}) \\ 11 & (5+(2\times3)) & ((2\times7)-3) & (\frac{({5}!!+7)}{2}) & ({5}!!+(3-7)) \\ 12 & \sqrt{(\frac{{(2\times3)}!}{5})} & (7+(2+3)) & ({5}!!-\sqrt{(2+7)}) & (\frac{{5}!}{(3+7)}) \\ 13 & (5+{2}^{3}) & (7+(2\times3)) & (7+{(5-2)}!) & (5+{(7-3)}!!) \\ 14 & (5+{3}^{2}) & (7\times\sqrt{({3}!-2)}) & (7+(2+5)) & (7\times(5-3)) \\ 15 & \sqrt{({5}!!\times{(2+3)}!!)} & (7+{2}^{3}) & (\frac{{(2+5)}!!}{7}) & (7+(3+5)) \\ 16 & (2\times(3+5)) & (7+{3}^{2}) & (2\times({5}!!-7)) & ((3\times7)-5) \\ 17 & (2+(3\times5)) & (3+(2\times7)) & (7+(2\times5)) & ({5}!!+\sqrt{(7-3)}) \\ 18 & ({5}!!+\sqrt{{3}^{2}}) & ({3}!\times\sqrt{(2+7)}) & ({5}^{2}-7) & ({3}!+(5+7)) \\ 19 & ({5}^{2}-{3}!) & ((3\times7)-2) & (5+(2\times7)) & ({5}!!-(3-7)) \\ 20 & (5+{(2+3)}!!) & (2\times(3+7)) & ({5}!!-(2-7)) & (5\times(7-3)) \\ 21 & (3\times(2+5)) & (\frac{{7}!!}{(2+3)}) & (7\times(5-2)) & (\frac{(3\times{7}!!)}{{5}!!}) \\ 22 & ({5}^{2}-3) & (7+{(2+3)}!!) & ({5}!!+\sqrt{{7}^{2}}) & (7+(3\times5)) \\ 23 & ({5}!!+{2}^{3}) & (2+(3\times7)) & (2+(\frac{{7}!!}{5})) & ({5}!!+{(7-3)}!!) \\ 24 & (\frac{{(2+3)}!}{5}) & {(7-\sqrt{{3}^{2}})}! & (2\times(5+7)) & {(\frac{(5+7)}{3})}! \\ 25 & (5\times(2+3)) & - & ({2}^{5}-7) & ({5}!!+(3+7)) \\ 26 & ({2}^{5}-{3}!) & (2+{(7-3)}!) & - & (5+(3\times7)) \\ 27 & {3}^{(5-2)} & (3\times(2+7)) & - & ({3}!+(\frac{{7}!!}{5})) \\ 28 & (3+{5}^{2}) & (7\times({3}!-2)) & - & ({3}!+({5}!!+7)) \\ 29 & ({2}^{5}-3) & ({{3}!}^{2}-7) & ({5}!!+(2\times7)) & ((5\times7)-{3}!) \\ 30 & (5\times(2\times3)) & ({3}!\times(7-2)) & ({5}!!+{(7-2)}!!) & (\frac{{5}!}{(7-3)}) \\ 31 & ({3}!+{5}^{2}) & (7+{({3}!-2)}!) & - & - \\ 32 & {2}^{(\frac{{5}!!}{3})} & \sqrt{{2}^{(3+7)}} & (7+{5}^{2}) & ((5\times7)-3) \\ 33 & ({(2\times3)}!!-{5}!!) & ((\frac{{7}!!}{3})-2) & ((5\times7)-2) & ((\frac{{5}!}{3})-7) \\ 34 & - & ({({3}!)}!!-(2\times7)) & ({7}^{2}-{5}!!) & - \\ 35 & (3+{2}^{5}) & (7\times(2+3)) & (\frac{{7}!!}{(5-2)}) & (\frac{{5}!!}{(\frac{3}{7})}) \\ 36 & ({3}!\times{(5-2)}!) & - & - & (3\times(5+7)) \\ 37 & - & (2+(\frac{{7}!!}{3})) & (2+(5\times7)) & (7+({3}!\times5)) \\ 38 & ({3}!+{2}^{5}) & - & - & (3+(5\times7)) \\ 39 & (3\times({5}!!-2)) & ({({3}!)}!!-(2+7)) & (7+{2}^{5}) & ({5}!!+{(7-3)}!) \\ 40 & (5\times{2}^{3}) & (\frac{{(7-2)}!}{3}) & (\frac{{5}!}{\sqrt{(2+7)}}) & (5\times{(7-3)}!!) \\ 41 & ({({3}!)}!!-(2+5)) & ({(2\times3)}!!-7) & - & ({3}!+(5\times7)) \\ 42 & ({3}!\times(2+5)) & (7\times(2\times3)) & ({7}!!\times(\frac{2}{5})) & (\frac{{7}!}{{(\frac{{5}!!}{3})}!}) \\ 43 & ({(2\times3)}!!-5) & ({7}^{2}-{3}!) & - & - \\ 44 & - & (2+({3}!\times7)) & ({7}^{2}-5) & - \\ 45 & (5\times{3}^{2}) & (3\times{(7-2)}!!) & (5\times(2+7)) & (3+(\frac{{7}!}{{5}!})) \\ 46 & - & ({7}^{2}-3) & - & ({({3}!)}!!+(5-7)) \\ 47 & (2+(3\times{5}!!)) & - & - & (7+(\frac{{5}!}{3})) \\ 48 & {(5-(2-3))}!! & {(7+(2-3))}!! & (\frac{{7}!}{{(2+5)}!!}) & {((3\times7)-{5}!!)}!! \\ 49 & ({2}^{{3}!}-{5}!!) & \sqrt{{7}^{({3}!-2)}} & (7\times(2+5)) & {7}^{(5-3)} \\ 50 & - & - & (\frac{({7}!!-5)}{2}) & (5\times(3+7)) \\ 51 & (3\times(2+{5}!!)) & (\frac{({7}!!-3)}{2}) & - & - \\ 52 & - & (3+{7}^{2}) & - & (7+(3\times{5}!!)) \\ 53 & (5+{(2\times3)}!!) & ({({3}!)}!!-(2-7)) & ((\frac{{5}!}{2})-7) & - \\ 54 & ((\frac{{5}!}{2})-{3}!) & ({3}!\times(2+7)) & (5+{7}^{2}) & - \\ 55 & ({({3}!)}!!+(2+5)) & (7+{(2\times3)}!!) & (\frac{(5+{7}!!)}{2}) & ({({3}!)}!!+(\frac{{7}!!}{{5}!!})) \\ 56 & ({5}!-{2}^{{3}!}) & (7\times{2}^{3}) & - & (7\times(3+5)) \\ 57 & ((\frac{{5}!}{2})-3) & ({7}!!-{(2\times3)}!!) & - & ({5}!!+({3}!\times7)) \\ 58 & ({({3}!)}!!+(2\times5)) & - & - & ({({3}!)}!!+\sqrt{({7}!!-5)}) \\ 59 & ({2}^{{3}!}-5) & ((2+{7}!!)-{({3}!)}!!) & - & - \\ 60 & \sqrt{(5\times{(2\times3)}!)} & \sqrt{({({3}!)}!\times(7-2))} & (\frac{({5}!!+{7}!!)}{2}) & (\frac{{5}!}{\sqrt{(7-3)}}) \\ 61 & ({({3}!)}!!-(2-{5}!!)) & - & - & - \\ 62 & - & ({({3}!)}!!+(2\times7)) & - & ((5+{7}!!)-{({3}!)}!!) \\ 63 & ({5}!!+{(2\times3)}!!) & (7\times{3}^{2}) & (\frac{{(2+7)}!!}{{5}!!}) & ({7}!!\times(\frac{3}{5})) \\ 64 & {(3+5)}^{2} & {{(7-3)}!!}^{2} & \sqrt{{2}^{(5+7)}} & {(5-7)}^{{3}!} \\ 65 & ({({3}!)}!!+(2+{5}!!)) & - & - & ({7}!!-(\frac{{5}!}{3})) \\ 66 & ({3}!+(\frac{{5}!}{2})) & - & - & (3\times({5}!!+7)) \\ 67 & - & - & (7+(\frac{{5}!}{2})) & - \\ 68 & - & - & - & - \\ 69 & (5+{2}^{{3}!}) & ({7}!!-{{3}!}^{2}) & - & ({({3}!)}!!+(\frac{{7}!!}{5})) \\ \hline \end{array}$$

Edit: Line Break issue (that someone else also noticed). Corrected $${{3}!}!!$$ to $${{(3}!)}!!$$ and $${{3}!}!$$ to $${{(3}!)}!$$. (The mathjax source is OK, but it doesn't combine right.)

– user63779
Commented May 5, 2020 at 1:37
• Impressive... even if some items are disqualified as per author's comment (e.g. 22 with 2,5,7) Commented May 5, 2020 at 7:47
• @David G. Are there any answers if we do not use !! double factorial?
– DrD
Commented May 5, 2020 at 12:08