# [seqfan] Re: n consecutive perfect powers sum to a perfect power

Tim Peters tim.peters at gmail.com
Wed Dec 27 05:25:13 CET 2023

```FYI, a quite different program, specialized for a(0) using your
observation, didn't find any solutions through sums less than 10^25, which
includes all 9-slices of perfect powers whose smallest addend has no more
than 24 decimal digits.

Only about 900 million sums needed to be checked. As powers get larger,
sequences of 9 consecutive perfect powers are increasingly composed of all
squares. Over a trillion were skipped because they were all squares.

BTW, I didn't follow the details of your explanation. What I believe is
correct instead:  For a fixed k, the sum of the 9 consecutive squares
starting at k^2, (k+i)^2 for i in 0 through 8, is:

3*(3*k^2 + 24*k + 68)

So, same conclusion: it's divisible by 3 with multiplicity 1, so can't be a
perfect power.

In other news, we now know all n such that a(n) has no more than 17 decimal
digits. There are only 2499 .This includes the monster

a(660599)  = 96_117_603_846_105_664

I don't have a way to push beyond that, though,, that doesn't swamp either
my RAM or CPU resources. So I'm settling instead for tackling the remaining
a(n) with n <= 1000. Only about a third of those have been resolved.

[nothing new below]
On Wed, Dec 13, 2023 at 9:09 PM Jack Brennen <jfb at brennen.net> wrote:

> I've been looking for a solution for 9 consecutive powers.
>
> If one exists, it's greater than 6.8 * 10^19.
>
> Note that any such solution must include an odd power (cube, 5th power,
> etc.).
>
> This is because the sum of 9 consecutive squares is of the form 9k^2 +
> 60, which can't be a perfect power of course, because it's divisible by
> 3 with multiplicity of 1.
>
>
>
> On 12/13/2023 8:21 PM, Tim Peters wrote:
> > I'll attach a Python program that works to cut off sums when it becomes
> > futile to pursue them. I assume your algorithm isn't doing that, because
> > this only takes about 2 seconds to finish 10^10 (running under PyPy).
> >
> > At 10^14 it took noticeable (very noticeable ;-) ) time, but still didn't
> > find a solution for sums of 9 or 10 consecutive powers. It found 744
> > solutions in all, the longest being a sum of 59924 consecutive powers,
> > starting at 37711881, summing to 92121066512784 (the square of 9597972).
> >
> > The code:
> >
> > from math import isqrt
> >
> > TOP = 10**10
> > SHOW_DELETES = False
> >
> > ppset = {1}
> > for i in range(2, isqrt(TOP) + 1):
> >     power = i
> >     while (power := power * i) <= TOP:
> > pp = sorted(ppset)
> > npp = len(pp)
> > MAXPP = pp[-1]
> > print(f"len(pp)={npp:_} through {TOP=:_}; {MAXPP=:_}")
> >
> > sums = pp[:]
> > nterms = 0
> > delta = 1
> > while sums:
> > ##    # Crucial invariant, but expensive to check.
> > ##    assert all(sums[i] == sum(pp[i : i + delta])
> > ##               for i in range(len(sums)))
> >      winner = -1
> >      for i, s in enumerate(sums):
> >          if s in ppset:
> >              winner = s
> >              assert sum(pp[i : i + delta]) == s
> >              break
> >      if winner > 0:
> >          nterms += 1
> >          print(nterms, delta, winner,
> >                f"starting at pp[{i}] = {pp[i]}, {len(sums)=:_}")
> >      if len(sums) + delta > npp:
> >          sums.pop()
> >          assert len(sums) + delta == npp
> >      for i in range(len(sums)):
> >          sums[i] += pp[i + delta]
> >          if sums[i] > MAXPP:
> >              if SHOW_DELETES:
> >                  print("    deleting", len(sums) - i,
> >                        "of", len(sums),
> >                        "at delta", delta)
> >              del sums[i:]
> >              break
> > ##    assert sums == sorted(set(sums))
> >      delta += 1
> >
> > On Wed, Dec 13, 2023 at 12:44 AM jnthn stdhr <jstdhr at gmail.com> wrote:
> >
> >> Howdy, all.
> >>
> >>    What is the least perfect power m (in A001597) that is the sum of n
> >> consecutive perfect powers.
> >>
> >>    The sequence isn't in the database, and begins 1, 25, 441, 100, 169,
> 289,
> >> 121, 2395417249, -1, -1, 676, 232324, -1, -1, -1, 64866916, 3721,
> >> 3622354596, 279936, ..., with -1 representing no solution found up to
> >> ~10^10.
> >>
> >>    For the first few terms, we have:
> >>
> >> {1}=1, {9+16}=25, {128+144+169}=441, {16+25+27+32}=100, etc.
> >>
> >>    Should I add this? If so, up to a(8) only, or include the -1s?
> >>
> >>   When I first searched for solutions, the maximum value of the set of
> >> perfect powers was ~10^8, and both a(8) and a(18) came out -1.  But
> when I
> >> increased the max to 10^10 solutions for those two terms were found.  At
> >> 10^8 I was able to get to 100+ terms in a somewhat reasonable time, with
> >> solutions becoming more and more sparse.  At 10^10, things get very
> bogged
> >> down, but more solutions are found along the way.  Also, the erratic
> nature
> >> of the terms seems to persist.
> >>
> >>    Can a solution always be found if the set of perfect powers is large
> >> enough?
> >>
> >> -Jonathan
> >>
> >> --
> >> Seqfan Mailing list - http://list.seqfan.eu/
> >>
> > --
> > Seqfan Mailing list - http://list.seqfan.eu/
> >
> >
>
```