Certain properties of numbers such that $n \mid 2^n+1$ A natural number $n>1$ is called good if$$n \mid 2^n+1.$$ For example, $n=3$ is good, as $3 \mid 2^3+1=9$. Prove that if $N_1$ and $N_2$ are good, then:


*

*$\mathrm{lcm}(N_1,N_2)$ and $\gcd(N_1,N_2)$ are good,

*$N_1\cdot N_2$ is good. 


This seems pretty difficult for me. Any hints?
 A: Here is a proof of part 1. Assume,
$$
n_1 \mid 2^{n_1}+1 \ \text{and} \ n_2 \mid 2^{n_2}+1.
$$
Denote, $d=gcd(n_1,n_2)$. We have,
$$
2^{n_1}\equiv -1 \pmod{d} \ \text{and} \ 2^{n_2}\equiv -1 \pmod{d}. 
$$
Now, from Bézout's identity, there exists $a,b\in\mathbb{Z}$ such that $d=an_1+bn_2$. Since, all of $d,n_1,n_2$ are odd, exactly one of $a,b$ is odd and the other one is even. Thus, $a+b$ is necessarily odd. Now,
$$
2^d \equiv 2^{an_1}2^{bn_2}\equiv (-1)^a(-1)^b \equiv (-1)^{a+b}\equiv -1 \pmod{d},
$$
proving that $(n_1,n_2) \mid 2^{(n_1,n_2)}+1$.
For the story involving least common multiple, let us assume that the set of all prime divisors of $n_1$ and $n_2$ is $\{p_1,p_2,\dots,p_k\}$ (after taking unions of all prime divisors of $n_1$ and $n_2$). Hence, by unique factorization theorem, there exists nonnegative integers $\{\alpha_1,\dots,\alpha_k\}$ and $\{\beta_1,\dots,\beta_k\}$ such that:
$$
n_1 = p_1^{\alpha_1}\cdots p_k^{\alpha_k} \ \text{and} \ n_2 = p_1^{\beta_1}\cdots p_k^{\beta_k}.
$$
Note that some of these numbers can very well be 0. Now, since 
$$
2^{n_1}+1 \mid 2^{[n_1,n_2]}+1 \ \text{and} \ 2^{n_2}+1 \mid 2^{[n_1,n_2]}+1 
$$, we have
$$
n_1 \mid 2^{[n_1,n_2]}+1 \ \text{and} \ n_2 \mid 2^{[n_1,n_2]}+1.
$$
Therefore, in the prime factorization of $2^{[n_1,n_2]}+1$, if the corresponding weights for $p_1,\dots,p_k$ are precisely $\theta_1,\dots,\theta_k$, we have
$$
\theta_i \geq \alpha_i \ \text{and} \ \theta_i\geq\beta_i,\forall i = 1,2,\dots,k \implies \theta_i \geq \max\{\alpha_i,\beta_i\},\forall i.
$$
Since the exponent of the prime $p_k$ in the factorization of $[n_1,n_2]$ is precisely $\max\{\alpha_i,\beta_i\}$, we are done.
Next, we will proceed into part 2. Assuming same notation for the prime decomposition of $n_1$ and $n_2$, we shall prove that
$$
p_i^{\alpha_i+\beta_i}\mid 2^{n_1n_2}+1, \forall i.
$$
Here's how to do it. Start with $p_1$, and assume that $\alpha_1 \geq \beta_1$ (you can do the exact same argument for the other case by swapping only one step below).
$$2^{n_1n_2}+1 = (2^{n_1}+1)\underbrace{((2^{n_1})^{n_2-1}-(2^{n_1})^{n_2-2}+\dots + 1)}_{\triangleq (*)}.$$
Clearly, since $n_1 \mid 2^{n_1}+1$, $p_1 ^{\alpha_1} \mid 2^{n_1}+1$. We will now prove that the second term in the factorization above is divisible by $p_1^{\beta_1}$, and by similar logic for the rest of the $p_2,\dots,p_k$, we will be done.
By our assumption, $\beta_1 \leq \alpha_1$, we have that $p_1^{\beta_1}\mid p_1^{\alpha_1}\mid 2^{n_1}+1$. Hence,
$$
2^{n_1}\equiv -1 \pmod{p_1^{\beta_1}}.
$$
Now, we will compute $(*)$ modulo $p_1^{\beta_1}$. It is easy to see that
$$
(*) \equiv \underbrace{1 + 1 + \dots + 1}_{n_2 \ \text{times}}\equiv n_2 \equiv 0 \pmod{p_1^{\beta_1}}
$$
hence, we are done. 
Had it been the case $\beta_1 \geq \alpha_1$, we could have used the equivalent factorization:
$$
(2^{n_2}+1)((2^{n_2})^{n_1-1}-(2^{n_2})^{n_1-2}+\dots + 1)
$$
to arrive at the result. Last step is to execute the exact same steps for $p_2,p_3,\dots,p_k$, in an analogous way, and conclude via the fact that the numbers $z_i \triangleq p_i^{\alpha_i+\beta_i}$ are mutually coprime, namely $(z_i,z_j) = 1$ if $i \neq j$. Since we have shown that each of $z_i$ divides $2^{n_1n_2}+1$ and they are all coprime, it must be the case that their product also divides $2^{n_1n_2}+1$. $\Box$
A: Let $n_1,n_2$ be two good numbers. Denote: $k = LCM(n_1,n_2)$ and $d = (n_1,n_2)$. Then we have simple relation: $dk = n_1n_2$.
For the first part, @Aaron has already done. The LCM part can be done more simple using the following property: if $a | x$ and $b | x$ then $LCM(a,b) | x$. In our case, $n_1 | 2^{n_1} + 1 | 2^k + 1$ and $n_2 | 2^{n_2} + 1 | 2^k + 1$ (as $k$ is odd). Thus $k | 2^k + 1$.
For the second part, 
$$2^{n_1n_2}+1 = 2^{dk} + 1 = (2^k+1)\bigg((2^k)^{d-1} - ... +1\bigg)$$
The first factor is divisible by $k$ (due to part $1$).
The second factor has $d$ terms. As $d| k|2^k + 1$ (due to part $1$), we have $2^k \equiv -1 \pmod d$. Thus, the second factor sums up to $d$ (modulo $d$) (note that $d-1$ is even). So the whole product is divisible by $dk = n_1n_2$.
A: You can prove "good" ness pretty easily without knowing much more about $N_1 $ and $N_2$, but I thought I'd share the properties that make numbers "good", and thus you can see that your problem becomes trivial.
We are going to go case by case where we assume something about $n$, take it to its conclusion, and then sew together the cases to get the overall answer.
Case 1: n is 1
1 divides every integer, and  21+1=3  is an integer. n = 1 is part of the solution set.
Case 2: n is even
If $n$ is even, every multiple of $n$ must also be even. But $2^n + 1$ is clearly odd, so no even $n$ will divide it. So $n$ cannot be even.
Case 3: If n is a power of an odd prime
Let $n=p^k$ where p is an odd prime. If $n$ divides $2^n + 1$, so does $p$
$2^n+1=2^{p^k} + 1 = 2^{p^{k-1}*p} + 1 = (2^{p^{k-1}})^p + 1$
$2^{p^{k-1}$ is relatively prime to $p$ (hint, both $p$ and $2$ are primes). Let $2^{p^{k-1}}$ = a
By Fermat's Little Theorem, we know that $a^p \equiv a\mod p$
So, $(2^{p^{k-1}})^p + 1 \equiv 2^{p^{k-1}} + 1\mod p)$
We can keep reducing this modulo $p$ and reducing the powers of $p$ in the exponent until we have only 1, so we get $2^p + 1 \equiv 2 + 1 \equiv 3\mod p$
This means that $2^n + 1 \equiv 3\mod p$ . But $p$ divides $2^n + 1$, so $p$ must divide 3 as well, i.e. $p = 3$
So if n is the power of an odd prime, it must be a power of 3.
Does this mean that all powers of 3 satisfy our condition? We don’t know yet. We are currently only gathering “necessary” conditions, not “sufficient”.
Case 4: If n is a product of powers of distinct odd primes
This is the last and most general case, as all odd numbers are a products of powers of odd primes. If $n$ is a product of prime powers, then let $p$ be least such prime that divides $n$.
Let $n = mp^k$ , where $m$ is a product of powers of primes larger than $p$, and $k$ is some integer.
Similar to case 3, we can see that $2^n + 1 = 2^{mp^k} + 1 = (2^{mp^{k-1}})^p + 1 \equiv 2^{mp^{k-1}} + 1\mod p$
We can keep reducing this modulo $p$ and pick off powers of p until we get $2^m + 1$
We have thus shown that if $p$ divides $2^n + 1$, it then divides $2^m + 1$
$2^m \equiv -1\mod p$, so $2^{2m} \equiv 1\mod p$ so $4^m \equiv 1\mod p$
Let $q$ be the order of $4\mod p$ (i.e. the lowest integer satisfying $4^q \equiv 1\mod p$). We know 4 has an order as it is relatively prime to any odd prime. We know $q$ divides $m$ as that’s a property of the order.
Also, as $q$ is the order of $4$ mod $p$ , $q$ must also divide $\phi(p)$, i.e. $q$ must also divide $p - 1$.
However, $q$ is clearly larger than $p - 1$ . $q$ is a divisor of $m$, and all divisors of $m$ are at least as big as their prime factors, all of which are larger than $p$ by design.. So $q$ cannot divide $p - 1$. This gives us our coveted contradiction.
So n cannot be a product of powers of distinct odd primes.
Cases 2 and 4 are eliminated.
So we are left with two cases

*

*$n = 1 $

*$n = 3^k$ for some integer $k$
This is really just one case ($3^0 = 1$), but we’ll get to that later. These $3^k$ powers are just candidates.
How do we prove that every power $3^k$ divides $2^{3^k} + 1$ ?
We can try proving this by induction. We know that for $k = 1$, $2^3 + 1 = 9$ which is divisible by $3^1$.
Let $2^{3^k} + 1 = a*3^k$, $a,k \in N $
All these exponents can make one feel wonky, but we can observe that $2^{3^k}$ can be turned into $2^{3^{k+1}}$ by cubing.
So cubing both sides, we get:
$2^{(3^k)(3)} + 3*2^{(3^k)(2)} + 3*2^{3^k} + 1 = (a^3)(3^{3k})$
$2^{3^{k+1}} + 1 = (a^3)(3^{3k}) - 3*2^{3^k}(2^{3^k} + 1) $
We know that $3^{3k}$ is clearly divisible by $3^{k+1}$ as $3k > k + 1$.
So let $(a^3)(3^{3k}) = b.3^{k+1}$
$2^{3^{k+1}} + 1 = b.3^{k+1} - 2^{3^k}*3*a*3^k$
$2^{3^{k+1}} + 1 = b.3^{k+1} - 2^{3^k}*a*3^{k+1}$
The RHS is clearly divisible by $3^{k+1}$, so we have our proof.
The answer is: all numbers $n=3^k$ where $k \geq 0$ satisfy the property “$n$ divides $2^n + 1$”
From this point, proving your statements about good numbers is trivial.
