2
$\begingroup$

What is the largest pair of consecutive numbers, not greater than a million, each of which can be expressed using precisely four fours and an assortment of standard operators (including concatenation, exponentation, square root, factorial, gamma fuction, decimals, and periodical decimals)?

In general, for each 2 < n < 11, what is the largest such set of n consecutive numbers?

$\endgroup$
2
  • 6
    $\begingroup$ Which operators in particular are allowed? Without specifying this, the question is subjective, and will likely be closed. $\endgroup$ – Deusovi May 12 at 19:32
  • $\begingroup$ Allowing a triad consisting of one decreasing unary operator (square root), one increasing unary operator (factorial) and one unary rounding operator (floor function), likely allows to create every number. $\endgroup$ – Vepir May 13 at 9:04
4
$\begingroup$

I found an answer

  • 907201=[(4/.4)!+4]/4

  • 907200=[(4/.4)!]/[sqrt(4)+sqrt(4)]

$\endgroup$
9
$\begingroup$

Assuming we can use the floor function (denoted here with brackets $\lfloor\cdot\rfloor$):

$$\left\lfloor\sqrt{\left\lfloor\sqrt{\left\lfloor\sqrt{\sqrt{\sqrt{\sqrt{4!!}}}}\right\rfloor}\right\rfloor!}\right\rfloor = 10 \\ \left\lfloor\sqrt{10}\right\rfloor! = 6$$

So we can make

$10^6 = 1,000,000$ with two fours.

Then we could simply do:

$10^6 - \sqrt4 = 999,998$

and

$10^6 - 4/4 = 999,999$

Edited to add: If floor function is allowed we can make each of the following using a single four:

$$\begin{align}1 &= \left\lfloor\sqrt{\sqrt{4}}\right\rfloor \\ 2 &= \sqrt{4} \\ 3 &= \left\lfloor\sqrt{10}\right\rfloor \text{(the expression for 10 given above)} \\ 4 &= 4 \\ 5 &= \left\lfloor\sqrt{\left\lfloor\sqrt{\sqrt{\sqrt{\sqrt{4!!}}}}\right\rfloor}\right\rfloor \\ 6 &= 3! \end{align}$$

and the following using two fours:

$$\begin{align}7 &= 6 + 1 \\ 8 &= 6 + 2 \\ 9 &= 6 + 3 \\ 11 &= 6 + 5 \\ 12 &= 4 \times 3\end{align}$$

then we could do:

all the numbers from 999,988 up to 999,999 to answer the last part of the question.

$\endgroup$
1
  • $\begingroup$ If you also use the gamma function and the ceiling function, and you only use numbers less than 2 billon, you can get every integer up to 93 with only a single 4. $\endgroup$ – user7868 May 13 at 3:21
3
$\begingroup$

It is know that with infinite stacking on unary operators and treating sqrt() as a unary operator you can get to any number with 4 4s, and the infinite 2s that sqrt() gives you. So, I redefined the problem a little. First off no stacking of unary operators so only one per 4 and binary operation, 7 total. Then as the question didn't really give a good list of operators and I have already discredited one that it did give I made my own list of operators:

Unary

  • -(x)
  • |x|
  • round(x)
  • floor(x)
  • ceiling(x)
  • truncate(x)
  • x! or gamma(x+1) (gamma(x) is (x-1)! and I consider x! to be the more canonical operator)

Binary

  • a+b
  • a-b
  • a*b
  • x/b
  • x^b
  • $\sqrt[y]{x}$
  • $\log_{y}x$
  • x%y (modulo)
  • x.y (concatenate keeping the sign of x)

from this I get that the largest pair is 979093, 979094 also the largest 2 numbers. 979093 can be made 24 different ways and 979094 can be made 4, although those ways could just be due to order of operations or something. Here are the first solution for each my exhaustive search found;

$$ 979093 = round(\frac{\sqrt[4]{(4+4!)!}}{4!}) $$ $$ 979094 = ceiling(\frac{\sqrt[4]{(4+4!)!}}{4!}) $$ Although typing this up I realise that I did not search the space were the first 4 had a unary operator applied I may do that tomorrow but that may not provide a better answer, as searching the space (x,x),(x,x) compared to (x,(x,(x,x))) didn't.

$\endgroup$
3
$\begingroup$

Largest pair using only explicitly listed (by OP) operators:

$999999 = (\Gamma (4) + 4)^{\Gamma (4)} - \Gamma(\sqrt 4)$
$1000000 = (\Gamma (4) + 4)^{\Gamma (4)} \times \Gamma(\sqrt 4)$

$\endgroup$
2
$\begingroup$

I have 919296 and 919297

..., but only if multi-factorials are allowed, with:
with 4 × (4!)!!!!! × 4 / 4 = 919296
and 4 × (4!)!!!!! + 4 / 4 = 919297

If this is not allowed, all I have is 331776 and 331777

with (4!)^4 × 4 / 4 = 331776
and (4!)^4 + 4 / 4 = 331777

This solution is specific to two consecutive numbers and does not allow me to generalize anything with 2 < n < 11, so you must have something else in mind.

$\endgroup$

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