# [seqfan] Re: permutation of nonnegative integers

jnthn stdhr jstdhr at gmail.com
Thu Apr 12 16:35:25 CEST 2018

```It looks like only two or three terms are ever added during any iteration,
and alernates 2,3,2,3... except when broken by three iterations in a row
n=(1,5,11,19,29,41,55,71,89,109,131,155,...) which appears to cycle on
numbers ending with 1,5,1,9,9 and equals https://oeis.org/A028387.
On Apr 12, 2018 3:09 AM, "Allan Wechsler" <acwacw at gmail.com> wrote:

> On the first iteration, a=0 and b=1. To start, a=0 is not in the sequence,
> so append it. Then, a+b = 1 is not in the sequence, so append it. Next,
> ab=0 is already there, so do nothing. Finally, b=1 is already in, so do
> nothing.
>
> On the second iteration, a=1 and b=2; this time around we skip a=1, but
> a+b=3 is new, so we adjoin it; ab=2 is also new, so it gets put on as well.
> But b=2 is now already there, so we skip it.
>
> On the third iteration, a=2 and b=3, and we skip 2, append 5 and 6, and
> skip 3.
>
> The fourth iteration with a=3 and b=4 gives the results 3, 7, 12, and 4,
> but 3 is already there so only 7, 12, and 4 join the sequence.
>
> In principle each iteration can yield as few as 0 and as many as 4 new
> entries.
>
> On Wed, Apr 11, 2018 at 10:27 PM, Neil Sloane <njasloane at gmail.com> wrote:
>
> > Of course they are of interest!  Roughly speaking if
> > it is worth discussing here it is worth including in the OEIS.
> >
> > BTW, could you elaborate on "Increment a and b".  What exactly does that
> > mean?
> >
> >
> > Best regards
> > Neil
> >
> > Neil J. A. Sloane, President, OEIS Foundation.
> > 11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
> > Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
> > Email: njasloane at gmail.com
> >
> >
> > On Wed, Apr 11, 2018 at 12:47 PM, jnthn stdhr <jstdhr at gmail.com> wrote:
> >
> > > Begin with a=0 and b=1 and include any of [a, a+b, a*b, b], in that
> > order,
> > > not already in the sequence.  Increment a and b.  The sequence begins:
> > >
> > > 0, 1, 3, 2, 5, 6, 7, 12, 4, 9, 20, 11, 30, 13, 42, 15, 56, 8, 17, 72,
> 19,
> > > 90, 10, 21, 110, 23, 132, 25, 156, 27, 182, 14, 29, 210, 31,...
> > >
> > > If a(n) is prime and a(n+1) is an even number, we get:
> > >
> > > 6, 12, 30, 42, 72, 90, 132, 210, 240, 342, 420, 462, 552, 702, 870,
> 930,
> > > 1122, 1260, 1332, 1560, 1722, 1980, 2352, 2550, 2652,...
> > >
> > > which appears to be A024701 (a(n) = (-1 + prime(n+1)^2)/4.)
> > >
> > > Of interest?
> > >
> > > --
> > > Seqfan Mailing list - http://list.seqfan.eu/
> > >
> >
> > --
> > Seqfan Mailing list - http://list.seqfan.eu/
> >
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>

```