[seqfan] Re: Nice nontrivial integer sequence

M. F. Hasler oeis at hasler.fr
Tue Mar 7 15:07:53 CET 2023


On Tue, Mar 7, 2023 at 4:40 AM Tim Peters <tim.peters at gmail.com> wrote:

> > oeis.org/draft/A360447:
> I believe people programming this can save some conditionals by noting
> this: (...)
> If the same new sum i'+j' = i+j appears later, when adding i' to the list,
> i' > i., so the larger addend (i') in this new way of spelling the sum is
> larger than the larger addend (i) in the way found before. In other words,
> the new way can never "win" - the first way found of achieving a new sum is
> the one that will eventually be used,


Yes I think that's right, but in order to keep track of where that is, you
have to update all positions of larger sums to the right whenever a new sum
is inserted.

I don't know whether this is possible in an efficient way, but when I tried
very early a similar idea (keeping track of positions of sums and updating
these positions)
it was horribly inefficient. <http://list.seqfan.eu/>

-M.


More information about the SeqFan mailing list