TITLE: Sum of squares and divisibility
QUESTION [25 upvotes]: Consider an integer of the form $$N = 1 + \sum_{i=1}^r d_i^2$$ where $d_i \in \mathbb{N}_{\ge 3}$ and $d_i^2$ divides $N$.
Question: Must $r$ be greater than or equal to $9$?
Checking (with SageMath):   It is true for $N \le 500000$.
Remark: If it is true in general then it is optimal because $$144 = 1 + 3^2 + 3^2 + 3^2+ 4^2  + 4^2  + 4^2  + 4^2  + 4^2  + 6^2$$

Motivation (from tensor category theory): If above question has a positive answer then by [1, Proposition 8.14.6] and [2, Theorem 3.4] a simple integral modular fusion category (over $\mathbb{C}$) would be of rank $ \ge 10 $. And for so, if required, we can also assume $d_i$ not a prime-power by [3, Corollary 6.16]. Then the (SageMath) checking is $N \le 10^6$; and above optimality would be unchanged because $$ 116964 = 1 + 6^2 +  18^2 + 38^2 + 38^2 + 114^2 + 114^2 + 171^2 + 171^2 + 171^2$$
We did not add this additional assumption at the beginning because it seems to be true without it (experimentally), and without it the question is (number theoretically) more interesting.
With this additional assumption, the next example with $r=9$ is $$ 396900 = 1 + 18^2 + 30^2 + 70^2 + 70^2 + 210^2 + 210^2 + 315^2 + 315^2 + 315^2 $$
Above two examples with $r=9$ can be excluded from coming from a fusion ring because:

First one: consider the simple object of FPdim $6$, multiply it with its dual (which must be itself here) and apply FPdim (ring homomorphism). Then you get $6^2=1+\cdots$, but there is no FPdim $\le 35$ (of a non-trivial simple object) which is not a multiple of $6$.
Second one: as above, $18^2 - 1 = 323$ is odd and the only odd FPdim for a non-trivial simple object is $315$ , but $323-315 = 8$ and there is no non-trivial simple object of FPdim $\le 8$.

Conclusion: if above two examples are the only ones for $r=9$ (I checked that there is no other one for $N \le 10^6$), and if above question has a positive answer (we can put the additional assumption if required), then a simple integral modular fusion category (over $\mathbb{C}$) would be of rank $ \ge 11 $.
References
[1]: P. Etingof, S. Gelaki, D. Nikshych, V. Ostrik; Tensor categories. Mathematical Surveys and Monographs (2015) 205.
[2]: J. Dong, S. Natale, L. Vendramin; Frobenius property for fusion categories of small integral dimension. J. Algebra Appl. 14 (2015), no. 2, 1550011.
[3]: D. Nikshych, Morita equivalence methods in classification of fusion categories, Hopf algebras and tensor categories, 289-325,
Contemp. Math., 585, Amer. Math. Soc. (2013).

REPLY [8 votes]: I hope so. But please double check (or, better, simplify) the argument below.
Denote $N=qs^2$ for $q$ squarefree. Then each $d_i$ divides $s$, say $d_i=s/m_i$ and we get $$q=1/s^2+\sum_{i=1}^r 1/m_i^2, \quad\quad\quad (\heartsuit)$$
and the sum of $r+1$ square reciprocals is integer. Since $d_i\geqslant 3$, we get $m_i\leqslant s/3$. Subtracting the summands with $m_i=1$ we get $(\heartsuit)$ with smaller $r$ and the same condition $m_i\leqslant s/3$ (possibly $q$ is no longer squarefree, but we do not care anymore.) So, now each $m_i$ is at least 2. So, we assume that $(\heartsuit)$ holds with $r\leqslant 8$, some integer $q$ and $s/3\geqslant m_i\geqslant 2$.
If $r=8$ and all $m_i$ are equal to 2, then $1/s^2$ must be an integer which is absurd. Otherwise $\sum 1/m_i^2\leqslant 7\cdot 1/4+1/9$ and $1/s^2+\sum 1/m_i^2\leqslant 1/36+7/4+1/9<2$, thus $q=1$.
Further we denote $s=m_{r+1}$, and $(\heartsuit)$ reads as $$1=\sum_{i=1}^{r+1} 1/m_i^2. \quad\quad\quad(\clubsuit)$$
And we have a
Special Condition. $m_{r+1}\geqslant 3\max(m_1,\ldots,m_r)$ and $m_i$ divides $m_{r+1}$ for all $i$.
What we do below is finding all solutions of $(\clubsuit)$ with $r\leqslant 8$. They all fail Special Condition. Let me start with listing them:
(a) $r=3$, $(2,2,2,2)$;
(b) $r=8$, $(2,2,2,3,6,6,6,6,6)$;
(c) $r=8$, $(2,2,3,3,4,4,4,4,6)$;
(d) $r=8$, $(2,2,2,4,4,4,6,6,12)$;
(e) $r=6$, $(2,2,2,4,4,4,4)$;
(f) $r=8$, $(2,2,2,3,3,12,12,12,12)$;
(g) $r=7$, $(2,2,2,3,4,4,12,12)$;
(h) $r=8$, $(2,2,2,3,9,4,4,36,36)$;
(i) $r=8$, $(2,2,2,3,4,4,12,15,20)$;
(j) $r=7$, $(2,2,3,3,3,3,6,6)$;
(k) $r=5$, $(2,2,2,3,3,6)$;
(l) $r=7$, $(2,2,2,3,3,7,14,21)$;
(m) $r=7$, $(2,2,2,3,3,9,9,18)$;
(n) $r=8$, $(3,3,3,3,3,3,3,3,3)$
(o) $r=0$, $(1)$.
Now goes a rather lengthy and boring proof that there are no other solutions of $(\clubsuit)$.
Denote by $2^\beta$ the maximal power of 2 which divides one of the numbers $m_i$, $i=1,\ldots,r+1$. We have $\beta\geqslant 1$: otherwise all $1/m_i^2$ are at most $1/9$, and not all equal to $1/9$, and RHS of $(\clubsuit)$ is less than 1. If we have exactly $h$ indices $i$ for which $2^\beta$ divides $m_i$, then multiplying $(\clubsuit)$ by $2^{2\beta}$ and considering the expression modulo 4 we get $4|h$. Thus $h=8$ or $h=4$ or $h=0$.
Consider several cases.

$h=0$, all $m_i$'s are odd. Then either $r=0$ and we get solution (0), or they all are not less than 3, and $\sum 1/m_i^2\leqslant 9\cdot 1/9=1$, with equality corresponding to solution (n).

$h=8$ and $\beta \geqslant 2$. Then RHS of $(\clubsuit)$ does not exceed $8\cdot \frac1{16}+1\cdot \frac14<1$.

$h=8$ and $\beta=1$. Then eight even $m_i$'s may be denoted by $2s_i$, $s_i$ are odd, $i=1,\ldots,8$, and $(\clubsuit)$ reads as
$$
\frac14\sum_{i=1}^8\frac1{s_i^2}+\frac{\varepsilon}{\ell^2}=1,\quad\quad\quad(\smile)
$$
where $\varepsilon=0$ if $r=7$ and $\varepsilon=1$ if $r=8$ (and $\ell$ is odd). At most three $s_i$'s may be equal to 1, others are at least 3, also $\ell\geqslant 3$, thus LHS of $(\smile)$ is at most
$\frac14(3\cdot1+5\cdot \frac19)+\frac19=1$, the equality case is unique, it is the solution (b).

$h=4$ and $\beta\geqslant 3$. Analogously, $(\clubsuit)$ reads as
$$
\frac1{4^\beta}\sum_{i=1}^4 \frac1{s_i^2}+\sum_{i=1}^{r-3}\frac1{\ell_i^2}=1,\quad\quad\quad(\ast)
$$
where $s_i$ are odd. At most 3 $\ell_i$'s are equal to 2. Assume that at least one of $\ell_i$'s is at least 4. Then LHS of $(\ast)$ is at most
$\frac1{64}\cdot 4+3\cdot\frac14+1\cdot\frac19+1\cdot\frac1{16}<1$, a contradiction. So, all $\ell_i$'s are equal to 2 or 3, and we get contradiction modulo 8 after multiplying by $4^\beta$.

$h=4$, $\beta=2$. Now we get
$$
\frac1{16}\sum_{i=1}^4 \frac1{s_i^2}+\sum_{i=1}^{r-3}\frac1{\ell_i^2}=1,\quad\quad\quad(\diamond)
$$


where $s_i$ are odd and $\ell_i$ not divisible by 4. Assume that at most one  $\ell_i$'s is equal to 2, then LHS of $(\diamond)$ does not exceed
$\frac1{16}\cdot 4+1\cdot \frac14+4\cdot \frac19<1$, a contradiction. Thus we get $r\geqslant 5$ and we may suppose $\ell_{r-3}=\ell_{r-4}=2$, and $(\diamond)$ reads as
$$
\frac1{16}\sum_{i=1}^4 \frac1{s_i^2}+\sum_{i=1}^{r-5}\frac1{\ell_i^2}=\frac12.\quad\quad\quad(\diamond\diamond)
$$
If all $\ell_i$'s ($i=1,\ldots,r-5$) are odd, we get a contradiction modulo 8 after multiplying by $16$. If none of $\ell_i$'s ($i=1,\ldots,r-5$) equals to 2, then one of them is at least 6, and LHS of $(\diamond\diamond)$ does not exceed $\frac1{16}\cdot 4+2\cdot \frac19+\frac1{36}=1/2$. There exists unique equality case, it corresponds to solution (c). Thus, we may suppose that $r\geqslant 6$ and $\ell_{r-5}=2$, and $(\diamond\diamond)$ reads as
$$
\frac1{16}\sum_{i=1}^4 \frac1{s_i^2}+\sum_{i=1}^{r-6}\frac1{\ell_i^2}=\frac14.\quad\quad\quad(\diamond\diamond\diamond)
$$
If exactly one of $\ell_i$'s ($i=1,\ldots,r-6$) is even (recall that it is not however divisible by 4), we get a contradiction modulo 8 after multiplying by 16. If two of $\ell_i$'s ($i=1,\ldots,r-6$) are even, then they are at least 6, and LHS of $(\diamond\diamond\diamond)$ is at most
$\frac1{16}(3+\frac19)+2\cdot \frac1{36}=\frac14$. Again, the equality case is unique, it provides a solution (d). Thus, all $\ell_i$'s ($i=1,\ldots,r-6$) are odd. If $r=6$, we immediately get $s_1=\ldots=s_4=1$, this gives solution (e). So, $r\geqslant 7$, at most 3 of $s_i$'s are equal to 1 and $$\sum_{i=1}^{r-6}\frac1{\ell_i^2}\geqslant \frac14-\frac1{16}\left(3+\frac19\right)=\frac1{18}.$$
Thus there is 3 or 5 between $\ell_i$'s, $1\leqslant i\leqslant r-6$.
Well, proceed with cases. Assume that $\ell_{r-6}=5$, but $\ell_{r-7}\ne 3$ (or $r=7$ and $\ell_1=5$). Then $\sum \frac1{s_i^2}=4-16\sum_{i=1}^{r-6}\frac1{\ell_i^2}\geqslant 4-\frac{32}{25}$. Therefore at least three $s_i$'s are equal to 1, say $s_2=s_3=s_4=1$, and $(\diamond\diamond\diamond)$ reads as $\frac1{16s_1^2}+\frac{\varepsilon}{\ell_{r-7}^2}=\frac1{16}-\frac1{25}=\frac9{16\cdot 25}$ (here $\varepsilon=0$ if $r=7$ and $\varepsilon=1$ if $r=8$). We see that $r=8$, and we get an equation $\frac1{\ell_1^2}=\frac{9}{16\cdot 25}-\frac1{16s_1^2}=\frac{(3s_1-5)(3s_1+5)}{16\cdot 25\cdot s_1^2}$. If 5 does not divide $s_1$, then $3s_1\pm 5$ is coprime to $25s_1^2$, and the numerator of $\frac{(3s_1-5)(3s_1+5)}{16\cdot 25\cdot s_1^2}$ may be equal to 1 only if both $3s_1-5$ and $3s_1+5$ are powers of 2, which is impossible (powers of 2 never differ by 10). So, $s_1$ is divisible by 5 and $\frac9{16\cdot 25}\geqslant \frac1{\ell_1^2}\geqslant \frac8{16\cdot 25}$, that is, $\ell_1=7$, but this does not provide a solution.
Assume then that $\ell_{r-6}=3$. Analogously, we get $\sum \frac1{s_i^2}+\frac{16\varepsilon}{\ell_{r-7}^2}=16(\frac14-\frac19)=\frac{20}{9}$. If all $s_i$'s are at least 3, then LHS is at most $4/9+16/9=20/9$, and equality holds in the unique case, corresponding to solution $(f)$.
So let us suppose that $s_4=1$, we get $\sum_{i=1}^3 \frac1{s_i^2}+\frac{16\varepsilon}{\ell_{r-7}^2}=\frac{11}9$. If all $s_1,s_2,s_3$ are at least 3, we get $r=8$ and $\frac{11}9\geqslant \frac{16}{\ell_1^2}\geqslant \frac{11}9-3\cdot \frac19=\frac{8}9$, that is impossible (recall that $\ell_1$ is odd). So, without loss of generality $s_3=1$ and $\frac1{s_1^2}+\frac1{s_2^2}+\frac{16\varepsilon}{\ell_1^2}=\frac29$. Clearly $s_1,s_2\geqslant 3$. If $r=7$, i.e., $\varepsilon=0$, this yields a solution with $s_1=s_2=3$, that is (g). So assume that $r=8$. Since $\frac{16}{\ell_1^2}<\frac2{9}$, we get $\ell_1\geqslant 9$. Thus $\frac1{s_1^2}+\frac1{s_2^2}\geqslant \frac29-\frac{16}{81}=\frac2{81}$. It yields $\min(s_1,s_2)\leqslant 9$.
If now $s_1,s_2$ are at least 5, then $\frac{16}{\ell_1^2}\geqslant \frac29-\frac2{25 }=\frac{32}{225}$, or $\frac{225}2\geqslant \ell_1^2$, this yields $\ell_1=9$. Thus $\frac1{s_1^2}+\frac1{s_2^2}=\frac2{81}$. If $s_1=s_2=9$, we get solution (h). Otherwise, say, $s_2=7$,
this does not lead to a solution.
Finally, if $s_2=3$, we get an equation $\frac1{s_1^2}+\frac{16}{\ell_1^2}=\frac19$, or
$\frac{16}{\ell_1^2}=\frac19-\frac1{s_1^2}=\frac{(s_1-3)(s_1+3)}{9s_1^2}$. If 3 does not divide $s_1$, then $s_1\pm 3$ are coprime to $9s_1^2$, so both $s_1-3$ and $s_1+3$ must be powers of 2. This happens only for $s_1=5$, and we get solution
(i). If $s_1=3k$, we get $\frac{(k-1)(k+1)}{9k^2}=\frac{16}{s_1^2}$, thus $k^2-1=(k-1)(k+1)$ is a positive perfect square, which is impossible.

Uff, now let $h=4$ and $\beta=1$. We get
$$
\frac14\sum_{i=1}^4\frac1{s_i^2}+\sum_{i=1}^{r-3}\frac1{\ell_i^2}=1
$$
for odd $s_i$ and $\ell_i$. Multiplying by 4 and considering modulo 8 we see that $r-3$ must be even, thus $r$ is odd, so $r\leqslant 7$. Therefore $\sum\frac1{\ell_i^2}\leqslant \frac49$ and $\sum\frac1{s_i^2}\geqslant 4(1-\frac49)=\frac{20}9$. This implies that at least two of $s_i$'s are equal to 1, say $s_3=s_4=1$. We get from above $\frac1{s_1^2}+\frac1{s_2^2}\geqslant \frac29$, so either $r=7$, $\ell_1=\ldots=\ell_4=3$, $s_1=s_2=3$,
that's solution (j), or, say, $s_2=1$, and we get $\frac1{4s_1^2}+\sum \frac1{\ell_i^2}=\frac14$. There is a solution (a) with $s_1=1$ and $r=3$. Otherwise $s_1\geqslant 3$ and we get $\sum \frac1{\ell_i^2}\in (\frac14-\frac1{36},\frac14)$. Thus, one of $\ell_i$'s is equal to 3, say $\ell_{r-3}=1$, and $\frac1{4s_1^2}+\sum_{i=1}^{r-4}\frac1{\ell_i^2}=\frac5{36}$. Assume that all remaining in LHS $\ell_i$'s are greater than 3, and that $s_1$ is greater than 3. Then $\frac1{4s_1^2}+\sum_{i=1}^{r-4}\frac1{\ell_i^2}\leqslant \frac1{100}+3\cdot \frac1{25}=\frac{13}{100}<\frac5{36}$.

Next case. $s_1=3$. Then $\sum_{i=1}^{r-4}\frac1{\ell_i^2}=\frac19$. If $r=5$, we get solution (k). Otherwise $r\geqslant 6$, then remaining $\ell_i$'s are at least 5, not all equal to 5, thus $\sum_{i=1}^{r-4}\frac1{\ell_i^2}\leqslant \frac1{25}+\frac1{25}+\frac1{49}<\frac19$.
Finally, let $s_1>3$, but $\ell_{r-4}=3$. Then $\frac1{4s_1^2}+\sum_{i=1}^{r-5}\frac1{\ell_i^2}=\frac1{36}$. If all $\ell_i$'s, $i\leqslant r-5$, are at least 11, then LHS is at most $1/100+2/121<1/36$. So, one of them equals to 7 or 9.
This leads to equations $\frac1{4s_1^2}+\frac1{\ell_1^2}=\frac{13}{36\cdot 49}$ and $\frac1{4s_1^2}+\frac1{\ell_1^2}=\frac{5}{4\cdot 81}$, respectively.
For $\frac1{4s_1^2}+\frac1{\ell_1^2}=\frac{13}{36\cdot 49}$ note that 7 must divide both $s_1$ and $\ell_1$ (otherwise we get a contradiction modulo 7 multiplying by 49, due to 13 being quadratic non-residue modulo 7). If, say, $s_1=7z$, $\ell_1=7w$, we get an equation $\frac1{4z^2}+\frac1{w^2}=\frac{13}{36}=\frac14+\frac19$. This is only possible for $z=1$, $w=3$ (for $w=1$ LHS is too large, otherwise too small). Surprisingly, this solution does not enjoy SC again.
For $\frac1{4s_1^2}+\frac1{\ell_1^2}=\frac{5}{4\cdot 81}$, we analogously get  that $s_1$, $\ell_1$ must be divisible by 9 (since 5 is not a quadratic residue modulo 3). So, we get an equation $\frac1{4z^2}+\frac1{w^2}=\frac{5}4$ which has the unique solution $z=w=1$, which leads to solution (m).