[seqfan] Re: The Bad Neighbors Sequence

Ruud H.G. van Tol rvtol at isolution.nl
Sun Jun 16 09:23:08 CEST 2024



On 2024-06-16 00:11, Ali Sada via SeqFan wrote:
> Hi everyone,
>
> In a town (list) of positive integers, no one wants to stay near their old neighbors.
> 1 doesn’t want to stay near 2 anymore, so, it inserts itself between 3 and 4.
> 2, 3, 1, 4, 5, 6, 7, 8,….
> a(1) = 1
> 2 doesn’t want to stay near 3 nor 1, so it inserts itself between 4 and 5.
> 3, 1, 4, 2, 5, 6, 7, 8,…..
> a(2) = 2
> 3 doesn’t want to stay near 2 nor 4 nor 1, so, it inserts itself between 5 and 6.
> 1, 4, 2, 5, 3, 6, 7, 8,….
> a(3) = 3
> Now, 1 doesn’t want to stay near 2 nor 3 nor 4, so, it inserts itself between 7 and 8
> 4, 2, 5, 3, 6, 7,1, 8,….
> a(4) = 1
> And so on.
>
> In the beginning, we insert L(1) between L(n+1) and L(n+2), but after a few steps, that doesn’t work anymore because L(1) finds closer places between new neighbors.
>
> I would really appreciate some help with the definition and the terms.

An early variant is to not stay next to the neighbors that you were born 
with,

1,2,3,...
__2,3,1,4,5,6,7,...
____3,1,4,2,5,6,7,...
____3,1,4,2,__6,7,5,8,9,10,...
____3,1,4,2,____7,5,8,6,9,10,11,...
____3,1,4,2,____7,5,8,6,_____11,9,12,10,13,14,15,...
____3,1,4,2,____7,5,8,6,_____11,9,12,10,___14,15,13,16,17...
____3,1,4,2,____7,5,8,6,_____11,9,12,10,______15,13,16,14,17...


which is A067060 (and A115659).

-- Ruud



More information about the SeqFan mailing list