20
$\begingroup$

I've been thinking about such an interesting question these last few days. I wonder if anyone has studied it.

Question: Find all postive integers $n$ such that $$S(n)=1^n+2^n+3^n+4^n+\cdots+n^n$$ is a square number?

Here $n=1$ is clear and if $n=3$ then $S(3)=36=6^2$. Now I can't find any other $n\le 20$, so I conjecture these $n$ are the only two values.

$\endgroup$
8
  • 12
    $\begingroup$ What have you done so far? Did you predict how often this should happen based on asymptotics? Check for obstructions (mod n)? Plug the sequence into OEIS? $\endgroup$ Commented Mar 5, 2018 at 13:42
  • 3
    $\begingroup$ If $n=2^k s$ and $k>0$ is even, then $S(n)$ is divisible by $2^{k-1}$, but not by $2^k$, thus can not be a perfect square. Analogously, if $n=4k+2$, then $S(n)$ is congruent to $n/2=2k+1$ modulo 8, thus $k$ must be divisible by 4. $\endgroup$ Commented Mar 5, 2018 at 22:00
  • 3
    $\begingroup$ oeis.org/A031971 (obtained plugging 4 terms 1, 5, 36, 354) $\endgroup$
    – YCor
    Commented Mar 5, 2018 at 22:53
  • 2
    $\begingroup$ I checked all $n \leq 4000$, and there were no new examples. $\endgroup$
    – S. Carnahan
    Commented Mar 7, 2018 at 14:52
  • 3
    $\begingroup$ By computing $S(n)$ efficiently mod $p$ for small $p$, I have verified that $S(n)$ is not a square for $4 \leq n \leq 10^{7}$. The most difficult $n$ was $n = 9676659$ for which $S(n)$ is a square mod $p$ for $3 \leq p \leq 149$. $\endgroup$ Commented Mar 8, 2018 at 18:16

4 Answers 4

21
$\begingroup$

This is not an answer, but I don't have enough reputation to comment. For large $n$, $S(n)\approx n^n.$ The density of square integers at $n^n$ is approximately $n^{-n/2}$. So one might expect that the number of $S(n)$ which are square is about $\sum_{\mathbb N} n^{-n/2} \approx 1.7788$.

$\endgroup$
6
  • 3
    $\begingroup$ I believe $S(n)$ is better approximated by $\frac{e}{e-1}n^n$, but up to a constant the order of magnitude is right. $\endgroup$
    – Wojowu
    Commented Mar 5, 2018 at 17:41
  • 15
    $\begingroup$ And given that the OP checked up to $n=20$ and the fact that $\sum_{n\ge21} n^{-n/2}\approx 1.5\cdot 10^{-14}$, the chances of there being any other examples is vanishingly small. $\endgroup$ Commented Mar 5, 2018 at 18:41
  • 3
    $\begingroup$ Denoting by $ C=\dfrac{e}{e-1} $, one has $C^{-1}(\sum_{n>0}n^{-n/2})^{2}\approx 2 $ . Is there a reason for this ? $\endgroup$ Commented Mar 6, 2018 at 0:44
  • $\begingroup$ (Technical comment to take new developments into account: two commenters at 2018-03-07 14:52:58Z and 2018-03-07 16:30:52Z not only "checked up to $n=20$ but up to $n=5500$, and still did not find another example.) $\endgroup$ Commented Mar 7, 2018 at 18:08
  • 1
    $\begingroup$ (but the argument also applies to the sequence $S_0(n){\bf =}n^n$, which is nevertheless a square more than half of the time). $\endgroup$ Commented Mar 7, 2018 at 18:24
9
$\begingroup$

An easy obstruction (mod 8). We can exclude all odd multiples of $4$, because for any $k\in\mathbb{N}$, $S(8k+4)=2\mod 4.$ (Reason: if $j$ is even, $j^{8k+4}=0\mod 4$, and if $j$ is odd, $j^{8k+4}=1\mod 4$, and there are $4k+2$ odd numbers from $1$ to $8k+4$).

$\endgroup$
7
  • 2
    $\begingroup$ You can also exclude those values which lead mod 8 to anything other than 0,1, or 4. This takes out a few more numbers mod 16. Gerhard "Then Try Mod Three Next" Paseman, 2018.03.05. $\endgroup$ Commented Mar 5, 2018 at 19:16
  • 1
    $\begingroup$ Exact, indeed $S(8k+6)=3\mod 4$ for all $k$, by a similar computation. $\endgroup$ Commented Mar 5, 2018 at 19:18
  • 1
    $\begingroup$ "Then Try Mod Three Next" : this takes out 3 numbers mod 18. In fact, for any prime $p$, $S(n)\mod p$ is periodic with period $(p-1)p^2$. For p=5, this takes out 15 numbers mod 100. (Not sure if this way one can exhaust all n though) $\endgroup$ Commented Mar 6, 2018 at 0:23
  • 1
    $\begingroup$ @PietroMajer no, only eventually periodic. For instance $\varphi(8)8^2=256$, but modulo 8 we have $S(2)\equiv 5$ while $S(258)\equiv 1$. $\endgroup$
    – YCor
    Commented Mar 7, 2018 at 22:58
  • 1
    $\begingroup$ We may exclude also odd multiples of $4^m$, see my comment to the question $\endgroup$ Commented Mar 10, 2018 at 8:02
1
$\begingroup$

A special case,

Thm 1:   if prime $\ p\equiv 3\ $ mod $4,\ $ then $\ 1^{p-1}+\ldots (p-1)^{p-1}\ $ is not a square.


$\endgroup$
0
$\begingroup$

Not a real answer either, but this link may be relevant : Faulhaber's formula

In particular one could try to establish, following Pietro Majer and Gerhard Paseman, that a solution of the diophantine equation $ S(n)=m^{2} =P_{n}(a)$ only occurs for odd values of $ n $, where $ a=n(n+1)/2 $ and $ P_{n} $ is the $ n $-th Faulhaber polynomial.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .