rec.puzzles Archive

Using the digits 1, 2, 3 and 4 once each, with various sets of allowed operations, how far can you form...

arithmetic/digits/equations/1234 New

New entry, edited from material collected for the archive and not yet in a released version.

Problem

Using the digits 1, 2, 3 and 4 once each, with various sets of allowed
operations, how far can you form every integer from 1 upward?

[ Editor: problem statement reconstructed from the posting, a summary
of results in the thread "One, Two, Three, Four"; see also
arithmetic/digits/equations/four.4. ]
Show solution
There are various rules which people have come up with so here is a
summary of the different results.  Can anybody improve on any of these?

  Allowing only the integers 1,2,3,4 and operations
  + - * ^ / and brackets ()
  1 to 33 are possible.

  Allowing also the factorial !
  1 to 75 are possible.

  Allowing also other integers made from the digits 1,2,3,4
  1 to 102 are possible.

  Allowing also a decimal point and square root
  1 to 132 are possible.

  Allowing also recurring decimal digits
  1 to 276 are possible.

Recurring decimals are indicated like this .(n)
e.g. .(2) = .22222...  = 2/9

-- Philip Gibbs <phil@eurocontrol.fr>

[ Editor: the expressions themselves were not in the collected
material. ]

[ Editor: from the thread "One, Two, Three, Four" (rec.puzzles, June
1995).  The rules here are the digits 1, 2, 3 and 4 once each with
+, *, -, !, ^ (and, in the expressions given, / and brackets). ]

In article <3rm7fu$bnl@styx.uwa.edu.au> hutch@ee.uwa.edu.au (Jason
Hutchens) writes:

   Well, using just the digits 1, 2, 3 and 4 exactly once only (and not
   "cheating" by making 12 a valid digit for example), and using the
   operators +, *, -, ! and ^ only, we can get all the numbers from 0
   to 100 except the following:-

   76, 77, 85, 86, 91, 92, 93

   I challenge anyone to get an expression for any of these (especially
   76, which we spent the most time deliberating about).

I then posted a partial spoiler giving solutions for 77 and 92. I have
since found a solution for 99. This spoiler includes a full list of
solutions so far, up to 102:

0        4-3!+2*1
1        (4+2)/3!*1
2        (4+2)/3*1
3        4+2-3*1
4        3!+2-4*1
5        4+3-2*1
6        4*3/2*1
7        4+3!/2*1
8        3!*2/4*1  [ Editor: this is 6*2/4 = 3, not 8. ]
9        2+3+4*1
10        2*3+4*1
11        2*4+3*1
12        3!*4/2*1
13        4+3^2*1
14        3!+2*4*1
15        4!-3^2*1
16        4!-2^3*1 [Editor: "4!-2^2*1" in the original]
17        4!-2^3+1 [Editor: "4!-2^2+1" in the original]
18        4!-2*3*1
19        4!-2-3*1
20        4*(2+3)*1
21        4!-3!/2*1
22        3!+2^4*1
23        4!-3+2*1
24        4*3*2*1
25        4!+3-2*1
26        2+4*3!*1
27        4!+3!/2*1
28        4!+3!-2*1
29        4!+2+3*1
30        4!+2*3*1
31        4!+2*3+1 [Editor: "4!=2*3+1" in the original]
32        4!+2^3*1
33        4!+3^2*1
34        4!+3^2+1
35        4!+3!*2-1
36        4!+3!*2*1
37        4!+3!*2+1
38        (3!+1)*2+4!
39        3!^2+4-1
40        3!^2+4*1
41        3!^2+4+1
42        4!*2-3!*1
43        4!*2-3!+1
44        4!*2-3-1
45        4!*2-3*1
46        4!*2-3+1
47        4!+(3!-2)!-1
48        (3+4)^2-1
49        (3+4)^2*1
50        (3+4)^2+1
51        3+4!*2*1
52        3+4!*2+1
53        4!*2+3!-1
54        4!*2+3!*1
55        4!*2+3!+1
56        (3!-1)!/2-4
57        (4+1)!/2-3
58        4^(1+2)-3!
59        3!^2+4!-1
60        3!^2+4!*1
61        4^3-2-1
62        4^3-2*1
63        4^3-2+1
64        4^3*(2-1)
65        4^3+2-1
66        4^3+2*1
67        4^3+2+1
68        2^3!+4*1
69        2^3!+4+1
70        4!*3-2*1
71        4!*3-2+1
72        4!*3*(2-1)
73        4!*3+2-1
74        4!*3+2*1
75        4!*3+2+1
76
77        (4!+2)*3-1
78        3^4-2-1
79        3^4-2*1
80        3^4-2+1
81        3^4*(2-1)
82        3^4+2-1
83        3^4+2*1
84        3^4+2+1
85
86
87        2^3!+4!-1
88        2^3!+4!*1
89        2^3!+4!+1
90        (4!+(2+1)!)*3
91
92        ((3!-2)!-1)*4
93
94        (3!-1)!-2-4!
95        4*(3!-2)!-1
96        4*(3!-2)!*1
97        4*(3!-2)!+1
98        (3!-1)!+2-4!
99        (4+3!)^2-1
100        (4+3!)^2*1
101        (4+3!)^2+1
102        (2^4+1)*3!
103

-- Nick Barnes <nickb@harlequin.co.uk>

[ Editor: the following note, "The Four Digits Problem" by Andy
Pepperdine, was in the TODO collection as a PDF (four-digits.pdf).
It is copied here in full under its Creative Commons licence.  The
typeset formulas have been put into plain ASCII: "." is the decimal
point (the original uses a raised midpoint), a recurring decimal is
written with the repeating part in parentheses, so .(1) = .1111... =
1/9, .(12) = .121212... = 12/99 and .1(3) = .13333... = 2/15 (the
original puts dots over the first and last repeating digit), "*" is
multiplication, "/" division (the original sets every division as a
stacked fraction), "^" a power, sqrt(x) the square root, and
root(n, x) the n-th root of x, i.e. x^(1/n), used where the original
writes a root sign with a non-integral or negative index n. ]

The Four Digits Problem
by Andy Pepperdine [Editor: spelled "Peppedine" in the original; the
companion note "The Four Equal Digits Problem" spells it Pepperdine]
2007-01-12
based on notes made 50 years ago.

This work is released under the Creative Commons Attribution -
Share-alike 2.5 license [1].

Make all integers from 0 upwards using the simplest mathematical
operators, as defined in some way, and the digits 1, 2, 3 and 4.
W. W. Rouse Ball gives this in his book Mathematical Recreations and
Essays[2] as a more interesting exercise than the normal Four Fours
where all the digits are 4.

He states on page 15, that with the digits 1, 2, 3 and 4, and
allowing the notation of the denary scale (including decimals), as
also algebraic sums, products, and positive integral powers, all
numbers from 1 up to 88 can be made.  If the use of symbols for square
roots and factorials, repeated a finite number of times, is also
permitted, then we can get to 264; if negative indices are also
permitted, to 276; and if fractional indices are permitted, to 312.

NB: I interpret the last comment about "fractional indices" to mean
the extraction of roots other than the square root by saying which one
to extract.  I cannot find any other solution to 277 and 307
otherwise.

The 89 values I cannot find up to 1000 are: 313, 331, 391, 407, 419,
421, 437, 439, 443, 446, 454, 455, 457, 461, 467, 493, 557, 559, 586,
587, 614, 617, 633, 653, 659, 661, 662, 667, 772, 773, 779, 787, 788,
791, 807, 813, 815, 817, 823, 831, 833, 850, 851, 853, 857, 859, 861,
867, 871, 874, 877, 879, 881, 883, 885, 886, 887, 893, 897, 906, 907,
908, 911, 913, 914, 915, 917, 919, 921, 922, 923, 927, 929, 931, 932,
933, 935, 941, 942, 946, 947, 949, 951, 953, 956, 979, 983, 986, 989.

Examples of each number from 0 upwards are given in the following
table.  I've tried to keep to the order in which Rouse Ball postulated
the use of operators, but also, I've used factorial in preference to
the square root sign, and allowed recurring decimals and integral
powers in preference to all other powers, factorials and roots.

Some interesting alternative methods are noted, too.

Five digits

Rouse Ball also gives the limits for 5 digits (1, 2, 3, 4 & 5) of 3832
without negative and fractional powers, and of 4282 with.  My
investigations indicate the same.

No.   Method
  0   1+4-3-2
  1   3+2-4*1
  2   1+2+3-4
  3   2*3+1-4
  4   4*2-3-1
  5   4+3-2*1
  6   4+3+1-2
  7   31-24
  8   4+3+2-1
  9   4+3+2*1
 10   4+3+2+1
 11   42-31
 12   4*3*(2-1)
 13   34-21
 14   21-3-4
 15   13+4-2
 16   4*(3+2-1)
 17   3*(1+4)+2
 18   32-14
 19   23-4*1
 20   21+3-4
 21   24-3*1
 22   43-21
 23   31-2*4
 24   4*(1+2+3)
 25   31-4-2
 26   23+4-1
 27   23+4*1
 28   32-4*1
 29   42-13
 30   13*2+4
 31   43-12
 32   3*12-4
 33   34+1-2
 34   34*(2-1)
 35   34+2-1
 36   32+4*1
 37   23+14
 38   42-3-1
 39   42-3*1
 40   12*3+4
 41   43-2*1
 42   41+3-2
 43   43*(2-1)
 44   4*(13-2)
 45   42+3*1
 46   32+14
 47   41+2*3
 48   3*(14+2)
 49   41+2^3
 50   13*4-2
 51   12*4+3
 52   2*(3/.1-4)  or  4^3-12
 53   3+2/(.1*.4)
 54   4*13+2
 55   42+13
 56   41+3/.2
 57   3*(4/.2-1)
 58   31*2-4
 59   31*2-3 [Editor: "31×3−4" in the original, which is 89 and uses
      the 3 twice]
 60   4*(3+12)
 61   13/.2-4  or  4^3-2-1
 62   (31*4)/2
 63   23+4/.1
 64   23+41
 65   (13*2)/.4
 66   31*2+4
 67   134/2
 68   34*2*1
 69   3*(24-1)
 70   2*(31+4)
 71   24*3-1
 72   4*(21-3)
 73   32+41
 74   21/.3+4
 75   3*(21+4)
 76   2*(41-3)
 77   (31-.2)/.4
 78   13*(2+4)
 79   41*2-3
 80   (32*1)/.4  or  3^4-2+1
 81   21*4-3
 82   41/(.2+.3)
 83   (2*4)/.1+3
 84   14*3*2
 85   (41*2)+3
 86   43*2*1
 87   (21*4)+3
 88   4*(23-1)
 89   4!+13/.2  or  4!/.2-31
 90   (3*12)/.4
 91   23*4-1
 92   23*4*1
 93   23*4+1
 94   2*(41+3!)
 95   (2+3/.4)/.1  or  4!*(3!-2)-1 [Editor: "4!×(3!−1)−1" in the
      original, which is 119 and uses the 1 twice]
 96   4*(21+3)
 97   (1+4)!-23
 98   (3!-1)!-4!+2
 99   (3*4)/.(12)  or  123-4!
100   (3*4)/.12  or  (4-3)*.1^-2
101   3^4+2/.1  or  .2^-3-4!
102   34*(2+1)
103   (3!)!*.2-41
104   13*4*2
105   42/(.3+.1)
106   (3*4)/.(1)-2
107   4!/.2-13
108   4*(1+2)^3
109   (4!-1)/.2-3!
110   (2*4+3)/.1
111   (1+4)!-3^2
112   4*(3/.1-2)
113   (1/.2)!-4-3
114   3*(4/.1-2)
115   23*(4+1)
116   4*(31-2)
117   3*(41-2)
118   (3*4)/.1-2
119   123-4
120   24/(.3-.1)
121   124-3
122   31*4-2
123   3*(42-1)
124   4*(32-1)
125   41*3+2
126   42*3*1
127   123+4
128   132-4
129   3*(41+2)
130   (41-2)/.3  or  124+3!
131   3/(.2*.(1))-4
132   134-2
133   (3/.(1)-.4)/.2  or  4!/.2+13
134   (4/.1+.2)/.3  or  (3+2)!+14
135   (31-4)/.2
136   134+2
137   (3/.(1)+.4)/.2  or  3/(.2*.(1))+sqrt(4)
138   (4/.3+2)/.(1)  or  (3!-1)!+4/.(2)
139   142-3
140   (42*1)/.3
141   143-2
142   3!*4!-2*1
143   (3*4)^2-1
144   12*4*3
145   142+3
146   3/(.1*.2)-4
147   21*(3+4)
148   (3/.1-.4)/.2  or  3!*(4!+1)-2
149   (3!)!*.2+4+1
150   (3*2)/(.1*.4)
151   31/.2-4
152   (3/.1+.4)/.2
153   (31-.4)/.2
154   3/(.1*.2)+4
155   (31*2)/.4
156   132+4!
157   314/2
158   .(2)/.(1)^3-4  or  (3!)!*.2+14
159   31/.2+4
160   32*(4+1)
161   2*3^4-1  or  (3+2)!+41
162   1*2*3^4
163   2*3^4+1
164   2*(3^4+1)
165   (34-1)/.2
166   .(2)/.(1)^3+4
167   (3!)!*.2+4!-1
168   42*(3+1)
169   34/.2-1
170   (34*1)/.2
171   34/.2+1
172   (3!)!*.(2)+4/sqrt(.(1))
173   13^2+4
174   4!+3/(.1*.2)  or  (3!)!/4-(2+1)!
175   (31+4)/.2
176   .2/.1^3-4!
177   4/(.2*.(1))-3
178   4!/.1(3)-2
179   31/.2+4!
180   (3*(4+2))/.1
181   (3*2)!/4+1
182   4!/.1(3)+2
183   4/(.2*.(1))+3
184   2^3*(4!-1)
185   (4-.3)/(.1*.2)
186   31*(2+4)
187   (4!-3)/.(1)-2
188   (3!)!*.(1)+4!/.(2)
189   (3*14)/.(2)
190   (41-3)/.2
191   4!*2^3-1
192   4^3*(2+1)
193   14^2-3
194   (43+.(1))/.(2)
195   (4/.(1)+3)/.2  or  (4!-2)/.(1)-3
196   .2/.1^3-4
197   4/(.1*.2)-3
198   (41+3)/.(2)
199   14^2+3
200   (4*(3+2))/.1
201   4!/.(12)+3
202   41/.2-3
203   4/(.1*.2)+3
204   .2/.1^3+4
205   41*(2+3)
206   23/.1-4!
207   (4/.2+3)/.(1)  or  4!/.(1)-3^2
208   41/.2+3  or  4!/.(1)-2^3
209   213-4
210   (14*3)/.2
211   214-3
212   (4!-3)/.1+2
213   24/.(1)-3
214   43/.2-1
215   (43*1)/.2
216   24/.(1)+3 [ Editor: as printed this is 216+3 = 219, the same as
      the entry for 219. ]
217   213+4
218   3!^(4-1)+2
219   24/.(1)+3
220   (41+3)/.2
221   4!/.(1)+3+2
222   24/.(1)+3!
223   (4!-2)/.1+3
224   (4+2)!*.3(1)
225   (3*(4+1))^2
226   23/.1-4
227   231-4
228   3!*(4/.1-2)  or  23/.1-sqrt(4)
229   231-sqrt(4)
230   (4/.2+3)/.1  or  (4!-1)/(.3-.2)
231   23/.(1)+4!
232   4*(3!/.1-2)  or  4!/.1-2^3
233   234-1
234   234*1
235   234+1
236   2*(3!-1)!-4
237   24/.1-3
238   241-3
239   3^(1/.2)-4
240   (4*3*2)/.1
241   3^(4+1)-2
242   243-1
243   243*1
244   243+1
245   3^(4+1)+2
246   41*3*2
247   3^(1/.2)+4
248   31*4*2
249   4!/.1+3^2
250   2*(4+1)^3
251   3!*42-1
252   21*4*3
253   3!*42+1
254   4^(3+1)-2
255   231+4!
256   4^(3+2-1)
257   (4!+2)/.1-3
258   4^(3+1)+2
259   (3!^4-1)*.2
260   (13*4)/.2
261   (4!+3+2)/.(1)
262   2^(4!*sqrt(.(1)))+3!  or  (3!)!*sqrt(.(1))+4!-2
263   4!/.1+23
264   4!*(13-2)
265   (.1^-2+3!)/.4
266   3!/(.2*.(1))-4
267   3^(1/.2)+4!  or  4!/.1+3!/.(2)
268   2*134
269   (2+3)!/.(4)-1
270   (23+4)/.1
271   (2+3)!/.(4)+1
272   4!/.1+32
273   4!/(.2-.(1))+3
274   3!/(.2*.(1))+4
275   (4!+31)/.2
276   (4+1)!*(2+.3)  or  (23*4)/sqrt(.(1))
277   34+root(-.2, sqrt(.(1)))
278   (3!)!*.4-sqrt(.1^-2)  or  sqrt(sqrt(sqrt(.1^-4!)))-(3!)!-2
279   (3+.(4))/.(1)^2
280   (21*4)/.3
281   (.2^-3-.(1))/.(4)
282   4!*12-3!
283   (3!)!*.4-1/.2
284   32/.(1)-4
285   4!*12-3
286   143*2
287   4^3/.(2)-1
288   (34-2)/.(1)
289   (13+4)^2
290   (4!+3+2)/.1
291   4!*12+3
292   32/.(1)+4
293   (3!)!*.4+1/.2
294   42*(3!+1)
295   (3!)!*.41-.2
296   3/.1^2-4
297   132/.(4)  or  321-4!
298   (3!/.1-.4)/.2  or  (4!+3!)/.1-2
299   (3+2)!/.4-1
300   3/.1^(4-2)  or  (3!)!*.4+12
301   (3+2)!/.4+1
302   (3!/.1+.4)/.2  or  (4!+3!)/.1+2
303   (1/.2)!/.4+3  or  (.2^-3-4!)/sqrt(.(1))
304   34/.(1)-2  or  3!/(.2*.1)+4
305   ((3!-1)!+2)/.4
306   34/(.(2)-.(1))  or  (32+sqrt(4))/.(1)
307   .3*root(.1, sqrt(4))-.2
308   312-4
309   (3!)!*.4+21 [Editor: the 4 carries a recurring dot in the
      original; with .(4) = 4/9 this would be 320+21 = 341]
310   4!*13-2
311   (3!)!*.(4)-sqrt(.(1)^-2)
312   314-2

Notation

The midpoint is used for the decimal point.  [ Editor: written "."
here. ]

Recurring decimals are written with dots over the first and last
digit of the recurring sequence.  So .(1) is the same as .1111...
(i.e. one ninth), .(12) is the same as .121212... (i.e. twelve
ninety-ninths, or four thirty-thirds), and .1(3) is the same as
.133333... (i.e. twelve ninetieths, or two fifteenths).  Some care is
required to see these dots and some printers may not be able to print
them well.  [ Editor: the dotted forms are written with parentheses
here, as explained at the top. ]

Addition, subtraction and multiplication are as normal, but division
is always given as a fraction.

The factorial function is represented as usual by a ! giving 3!=6 and
4!=24.

Square roots are also as usual, with sqrt(4)=2 and sqrt(.(1))=1/3.

To get 277 and 307, and some higher numbers, I have assumed that
Rouse Ball was using the notation of an n-th root where n is not
integral.  So root(.1, 2) = 2^10 = 1024, and negative roots are the
equivalent of reciprocal powers, so root(-.2, .(3)) = (1/3)^-5 = 3^5 =
243.

References

[1] Creative Commons License, http://creativecommons.org/licenses/by/2.5/
[2] W.W. Rouse Ball, revised by H.S.M. Coxeter, Mathematical
    Recreations and Essays, 11th edition, 1939, reprinted in 1967 by
    Macmillan, p15ff.

-- Andy Pepperdine, "The Four Digits Problem" (2007), CC BY-SA 2.5