Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let S be the set $\{0!, 1!, 2!, \ldots\}$. Is it possible to construct any positive integer using only addition, subtraction and multiplication, and using any element in S at most once? For example:

$$ 3 = 2! + 1!$$ $$ 4 = 3! - 2! = 2! + 1! + 0!$$ $$ 146 = 4!\cdot3! + 2!$$

etc. My gut instinct says that this isn't true, but I can't see why. Something like 8076 doesn't have an obvious solution, but maybe you can get it by subtraction a huge factorial from the product of two smaller factorials or something. Or maybe there's a way of finding sets of factorials that add/subtract/multiply to 1, in which case any number can be constructed this way. I've tried finding something but haven't had much luck.

EDIT: Oops, positive integer, not positive number.

share|cite|improve this question
Do you mean positive integer? Any positive even integer can be written as the sum of $2!$s, and any positive odd integer is $1!$ plus some nonnegative even integer. – user17794 Jul 23 '12 at 19:31
@TimDuff: "and using any element in $S$ at most once"; so you can only use 2! at most once. – Arturo Magidin Jul 23 '12 at 19:32
Do you allow the use of parens? – ncmathsadist Jul 23 '12 at 19:40
Note, since $0!=1!$, it isn't technically a "set" if you mean you can use $0!$ and $1!$. Just a minor language nit. – Thomas Andrews Jul 23 '12 at 19:42
@EricStucky No, he explicitly uses 0! and 1! in one of his examples, so he clearly means something like, "Express every natural number in terms of the sequence 0!,1!,...,k!,... with each term used at most once." – Thomas Andrews Jul 23 '12 at 20:07
up vote 17 down vote accepted

Let me assume you're only allowed to use $0! = 1!$ once. In that case, all factorials past $4!$ are divisible by $24$, so working $\bmod 24$ the only numbers you're allowed to use are $1, 2, 6$, each at most once, and I am reasonably certain you cannot get any numbers congruent to $10 \bmod 24$ this way.

Edit: If you want to use both $0!$ and $1$, then all factorials past $5!$ are divisible by $120$, so working $\bmod 120$ the only numbers you're allowed to use are $1, 1, 2, 6, 24$. This time I am reasonably certain you cannot get any numbers congruent to $57 \bmod 120$. Just kidding! Every conjugacy class $\bmod 120$ is reachable.

Okay, working $\bmod 720$ the only numbers you're allowed to use are $1, 1, 2, 6, 24, 120$...

share|cite|improve this answer
for example $10=4!-2!*(3!+1!)$. But I'm not sure whether we were allowed to use parentheses – Tigran Hakobyan Jul 23 '12 at 20:16
1+6+2*(24+1)=57 – Colin McQuillan Jul 23 '12 at 21:43
@mjqxxxx: I just ran a (hopefully) exhaustive search, and it seems there's no way to obtain the numbers 352, 356, 364 or 368 modulo 720 from 1, 1, 2, 6, 24 and 120 using addition, multiplication and negation. – Ilmari Karonen Jul 23 '12 at 22:34
I got the same result [352,356,364,368] with this code: – Colin McQuillan Jul 23 '12 at 23:07
@Belgi: well, it suffices to get the first $60$. You can get $0$ through $19$ without using $24$, so by reusing all of those representations you can get $0$ through $43$ by using $24$. Then I checked $44$ through $60$... – Qiaochu Yuan Jul 23 '12 at 23:48

Relaxing your restriction using each factorial at most once, you may find the following helpful. For every positive integer $n$ there is a positive integer $k$ and $k$ positive integers $\{c_1, \dots, c_k \}$ such that $n$ has a unique representation in the factorial basis, \begin{align} n = \sum_{l = 1}^{k} c_{l} \ l!. \end{align}

share|cite|improve this answer
He wants to use each number at most once – Thomas Andrews Jul 23 '12 at 20:18

The numbers you can construct are of the form $\sum_{j=0}^nc_jj!$ with $c_j\in\{-1,\,0,\,+1\}$. Imagine you want to construct a number smaller than $4165$. Since $7!-\sum_{j=0}^6j!=4166$, you can only use the numbers $k!$ with $0\leq k\leq 6$. That's $7$ numbers. Using your formula you can construct $3^7=2187$ numbers this way. Sadly, $2187<4165$ so the answer is no.

share|cite|improve this answer
I like this line of thought, but you can also multiply factorials together, so there'll be more than 2187 combinations. – Hovercouch Feb 28 '14 at 18:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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