<s>[INST] Any suggestions on a closed form of $\sum_{a=1}^{N} \left({\lfloor{\frac{N+1}{a}}\rfloor+\lfloor{\frac{N-1}{a}}\rfloor}\right)$ Now the sum is approximated by $$\sum_{a=1}^{N} \left({\left\lfloor{\frac{N+1}{a}}\right\rfloor + \left\lfloor{\frac{N-1}{a}}\right\rfloor}\right) \approx 2 \sum_{a=1}^{N} \left\lfloor{\frac{N}{a}}\right\rfloor$$.
when $N$ is large.  This part of my on going research in polynomial factoring with constraints over the coefficients.  I am looking for a possible closed form solution or if I can combine these two sum terms into one term.
 [/INST] A first useful point to consider is that
$$
\eqalign{
  & \left\lfloor {{{N + 1} \over a}} \right\rfloor  + \left\lfloor {{{N - 1} \over a}} \right\rfloor  =   \cr 
  &  = {{N + 1} \over a} + {{N - 1} \over a} - \left\{ {{{N + 1} \over a}} \right\} - \left\{ {{{N - 1} \over a}} \right\} =   \cr 
  &  = {{2N} \over a} - \left( {\left\{ {{{N + 1} \over a}} \right\} + \left\{ {{{N - 1} \over a}} \right\}} \right) \cr} 
$$
And a second one is that
$$
\eqalign{
  & \left\{ x \right\} + \left\{ y \right\} =   \cr 
  &  = \left\{ {x + y} \right\} + \left\lfloor {\left\{ x \right\} + \left\{ y \right\}} \right\rfloor  =   \cr 
  &  = \left\{ {x + y} \right\} + \left[ {1 \le \left\{ x \right\} + \left\{ y \right\}} \right] \cr} 
$$
where $[P]$ denotes the Iverson bracket
From these, you can get a rough estimate, considering that the fractional part is less than one,
and on avg. it can be take to equal $1/2$.
Then it depends on the approximation you need to reach.
A further point is that
$$
\eqalign{
  & \left\lfloor {x + y} \right\rfloor  =   \cr 
  &  = \left\lfloor x \right\rfloor  + \left\lfloor y \right\rfloor  + \left\lfloor {\left\{ x \right\} + \left\{ y \right\}} \right\rfloor  =   \cr 
  &  = \left\lfloor x \right\rfloor  + \left\lfloor y \right\rfloor  + \left[ {1 - \left\{ x \right\} \le \left\{ y \right\}} \right]\quad  \Rightarrow   \cr 
  &  \Rightarrow \;\quad \left\lfloor {{{N + 1} \over a}} \right\rfloor
  = \left\lfloor {{{N - 1} \over a}} \right\rfloor  + \left\lfloor {{2 \over a}} \right\rfloor  + \left[ {1 - \left\{ {{2 \over a}} \right\} \le \left\{ {{{N - 1} \over a}} \right\}} \right] \cr} 
$$
which for $a=1$ and for $a=2$ gives simple results, and for $3 \le a$ becomes
$$
\eqalign{
  & \left\lfloor {{{N + 1} \over a}} \right\rfloor \quad \left| {\;3 \le a} \right.\quad  =   \cr 
  &  = \left\lfloor {{{N - 1} \over a}} \right\rfloor  + \left[ {{{a - 2} \over a} \le \left\{ {{{N - 1} \over a}} \right\}} \right] =   \cr 
  &  = \left\lfloor {{{N - 1} \over a}} \right\rfloor  + \left[ {a - 2 \le \left( {N - 1} \right)\bmod a} \right] =   \cr 
  &  = \left\lfloor {{{N - 1} \over a}} \right\rfloor  + \left[ {a - 2 = \left( {N - 1} \right)\bmod a} \right] + \left[ {a - 1 = \left( {N - 1} \right)\bmod a} \right] =   \cr 
  &  = \left\lfloor {{{N - 1} \over a}} \right\rfloor  + \left[ {0 = \left( {N + 1} \right)\bmod a} \right] + \left[ {0 = N\bmod a} \right] =   \cr 
  &  = \left\lfloor {{{N - 1} \over a}} \right\rfloor  + \left[ {a\backslash N} \right] + \left[ {a\backslash \left( {N + 1} \right)} \right] \cr} 
$$
so that the sum of the two terms differ for the number of divisors
of $N$ and $N+1$.
</s>