5

Let $a\ge 2$ be an integer. Prove that $\exists n\ge 1$ such that $$2n+1\mid a+n! \text{ or }a-n!$$ I think we'll construct a solution for $n$ as a function of $a$. But I have no idea what that function looks like. I just took care of some trivial cases.

First if $a$ is a factorial number i.e. $a=k!$ then set $n=k$

If $a$ is of the form $k!+2k+1$ then set $n=k$ and observe that $$a-n!=2k+1$$

Note that if $a\equiv 1$ or $2$ $\pmod 3$ then set $n=1$,so we only have to deal with multiples of $3$ now .

PNT
  • 4,164
  • Starting with $a = 2$, the smallest values of $n$ satisfying the condition are 1, 2, 1, 1, 3, 1, 1, 20, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1. See any patterns? – Dan May 06 '22 at 20:49
  • @Dan see the edit – PNT May 06 '22 at 21:23
  • 2
    And though it's not always the smallest possible $n$, $n=4$ covers all the multiples of $3$ which are not multiples of $9$. $a=9 \implies n \geq 20$ is a doozy though. – aschepler May 06 '22 at 21:45
  • If $n=1$ then $3|a+1$ only if $a\equiv 2 \mod 3$ but not when $a\equiv 1 \mod 3.$ – DanielWainfleet May 06 '22 at 22:07
  • 1
    @DanielWainfleet Note if $a \equiv 1 \bmod 3$, then with $n = 1$ we have $(2n + 1 = 3) \mid (a - n! = a - 1)$, i.e., the second option of $2n + 1 \mid a - n!$ can be used instead. – John Omielan May 06 '22 at 22:09

3 Answers3

2

Note that if $2n+1$ is prime, then by Wilson's theorem:

$$-1 \equiv (2n)!\equiv (-1)^{n}(n!)^2 \mod (2n+1)$$

Thus $(n!)^2 \equiv (-1)^{n+1} \mod (2n+1)$

Thus if $2n+1$ is a prime of the form $1\text{mod}$ $ 4$ then $(n)!^2 \equiv -1 \mod(2n+1)$ (also some thanks to John Omielan).

Claim: For all $a \geq 2$, $a^2+1$ contains primes of the form $1 \mod 4$.

Proof:

By quadratic reciprocity, it contains no primes of the form $3\mod 4$. Hence, if it contains no primes of the form $1 \mod 4$ then it is a power of $2$. Thus we must have $a^2+1 = 2^{j}$ with $j \geq 2$ for some $a$. But $a^2+1 \equiv 1 \text{ or }2 \mod 4$, which is impossible.


Let $p_{a}$ be a prime $1 \mod 4$ that divides $a^2+1$. Note that $((\frac{p_{a}-1}{2})!)^2 \equiv -1 \mod p_{a}$ and, therefore;

$$p_{a}| a+\left(\frac{p_{a}-1}{2}\right)! \text{ or }a-\left(\frac{p_{a}-1}{2}\right)! $$

$$\Leftrightarrow \left(a+\left(\frac{p_{a}-1}{2}\right)!\right)\left(a-\left(\frac{p_{a}-1}{2}\right)!\right) \equiv 0 \mod p_{a}$$

$$\Leftrightarrow a^2+1 \equiv 0 \mod p_{a}.$$

The last statement is true. Thus $n = \frac{p_{a}-1}{2}$ does the trick.

PNT
  • 4,164
  • Note your statement that for $2n + 1$ prime that $n! \equiv \pm 1 \pmod{2n+1}$ is actually only true iff $2n + 1 \equiv 3 \pmod{4}$ (e.g., as stated in this answer, we have $\left[\left(\frac{p-1}2\right)!\right]^2 \equiv (-1)^{(p+1)/2} \pmod{p}$, so for $p \equiv 1 \pmod{4}$, we get $\left[\left(\frac{p-1}2\right)!\right]^2 \equiv -1 \pmod{p}$). For example, with $n = 2$, then $2n + 1 = 5$, but $2! = 2$ and $2 \not\equiv \pm 1 \pmod{5}$. – John Omielan May 06 '22 at 23:20
  • Yes you are right, my bad. – acreativename May 06 '22 at 23:22
0

As you've already noted, $n = 1$ works with either $a \equiv 1 \pmod{3}$ (since $3 \mid a - 1$) or $a \equiv 2 \pmod{3}$ (since $3 \mid a + 1$). Also, as aschepler's question comment indicates, $n = 4$ works where $a$ has just one factor of $3$. This is because with $a = 3i$, then if $i \equiv 1 \pmod{3}$, we get $a + 4! = 3(i + 8) \equiv 0 \pmod{9}$, while if $i \equiv 2 \pmod{3}$, then $a - 4! = 3(i - 8) \equiv 0 \pmod{9}$.

This just leaves where $a$ is an integral multiple of $9$. As Dan's question comment indicates, $n = 20$ works for $a = 9$. Consider next if $a$ has any other odd factors, say $j \gt 1$. If so, then $2n + 1 = 9j \; \to \; n = \frac{9j - 1}{2}$ works since $3(3j) \mid a$, with $3 \neq 3j$, plus $3 \lt n$ and $3j \lt n$, so $3(3j) \mid n!$, which means $2n + 1 \mid a + n!$ (as well as $2n + 1 \mid a - n!$).

The final case to consider is with $a = 9(2^k)$ for $k \ge 1$. Then for $k = 1$ let $b = a + 1$, and for $k \ge 2$ let $b = a - 1$. Then $b \equiv 3 \pmod{4}$, so there's at least one prime $p \equiv 3 \pmod{4}$ where $p \mid b$. Let $p = 2n + 1 \; \to \; n = \frac{p - 1}{2}$. Then as shown in If $p\equiv 3\pmod{4}$ is a prime, then $\frac{p-1}{2}! \equiv \pm1 \pmod p$, we get that $n! \equiv \pm 1 \pmod{p}$. Thus, since $a \equiv \pm 1 \pmod{p}$, we have that either $2n + 1 \mid a + n!$ or $2n + 1 \mid a - n!$.

This concludes the proof since all cases for $a$ have been handled.

John Omielan
  • 47,976
0

We use this fact that $b\mid 2^{b!}-1$; we can write:

$$2^{(2n+1)!}-1\equiv 0\bmod (2n+1)$$

$(2n+1)!=n!\times(n+1)(n+1+1)\cdot\cdot\cdot(2n+1)=n!+ m$

$$2^{(2n+1)!}-1=2^{n!}\times 2^m-1\equiv 0\bmod (2n+1)$$

$2^m=(1+1)^m=2+P(m)$

where $P(m)$ is a polynomial for $m$, so we may write:

$$2^{(2n+1)!}-1=2^{n!}[2+P(m)]-1\equiv 0\bmod (2n+1)$$

$$2^{n!}+ 2^{n!}[1+P(m)]-1\equiv 0\bmod(2n+1)$$

$2^{n!}=2+n!(t+1)=n!+n!t+2$

finally:

$$2^{n!}+2^{n!}[1+P(m)]-1=n!+\{n!t+2+2^{n!}[2+P(m)]-1\}\equiv \bmod (2n+1)$$

here $a=n!t+2+2^{n!}[2+P(m)]-1$

sirous
  • 10,751