**Angry Naturals**

(and Primes)

Hello SeqFans,

Here is another
reordering of the Naturals (as I got no reply for my former
post -- sigh!);

Imagine that an Angry
Natural Number could not stand the presence of his immediate neighbors -- thus
asking them to stay away;

The acceptable
"stay away" distance would be given by the said angry Natural himself
-- this meaning that "5", for instance, would not accept to see
"4" and "6" at a shorter distance than 5 integers from him;

Sequence S(1) is one packing of such Angry naturals:

**S**(1) =
1,4,7,2,10,13,16,3,5,.,.,8,.,.,.,6,11,.,.,.14,9,.,.,.,.,.,.,.,12,.,.,.,.,.,.,15,...

S(1) is build
according to the "place the Naturals first" method -- see again the
former msg, here.

But we could also
use the other building method mentioned on the same page -- "fill the
‘holes’ first" --, which would give:

**S**(2) =
1,3,5,7,9,2,11,13,4,15,17,6,19,21,8,23,25,27,10,29,31,12, ...

S(2) comes
lexicographically first.

Best,

É.

__________

**Franklin T. Adams-Watters** replied:

If the requirement
is that the neighbor must be at least n away, instead of more than n away, the
first packing method gives A072009.

The corresponding
sequence for the second approach is not in the database.

A065186 and A065187 are also
kind of similar.

One can also look for
the lexically first such sequence that is also a self-inverse permutation. If I
haven't made any mistakes, for Eric's definition this starts:

1,4,8,2,10,17,25,3,19,5,21,34,13,28, ...

while my
variant starts:

1,4,7,2,9,15,3,17,5,19,30,12,25,39,6, ...

For the rule in A065186
(consecutive integers may not be adjacent), this starts:

1,4,6,2,5,3,

and then this pattern
repeats with each block 6 larger: a(n+6)=a(n)+6.

None of these are
in the database.

Franklin T.
Adams-Watters

__________

Many thanks,
Franklin, for the interesting comments (and links).

More comments
appeared on SeqFan mailing list a few days later:

If the requirement
is that n must be exactly n terms away from n-1, instead of at least n away or
more than n away, I found:

1,4,2,131,129,3,5,16,14,12,10,8,6,31,29,27,25,23, ... and the next term a(19)
seemed to be difficult.

Surprisingly, the
sequence seems to be A057167: “Term
in Recaman's sequence A005132 where n appears for first time, or 0 if n never appears”

1,
4, 2, 131, 129, 3, 5, 16, 14, 12, 10, 8, 6, 31, 29, 27, 25, 23, 99734, 7, 9,
11, 13, 15, 17, 64, 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 111,
22, 20, 18, 28, 30, 32, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202,
200, 198, 196

So it's easy to
see why a(19)=99734 was difficult.

The
"angry" property is not mentioned in A057167

**John W. Layman**

---

This breaks for
26, which is the first number that does not occur in A057167; because
A005132(26) = A005132(18) = 43 is the first
duplication in Recaman's sequence.

**Franklin T. Adams-Watters**

__________

Now, what about Angry Primes?

If the Primes were
angry -- and only them, not the other Naturals -- we would have no more than
the #2 building method: “Fill the next ‘hole’ with the smallest integer not
used so far and not leading to a contradiction”.

This, together
with the first rule -- “There must be at least P(n)
naturals between P(n) and P(n-1)

&
there must be at least P(n) naturals between P(n) and
P(n+1)” -- would produce:

**S(**3) = 1,2,4,5,6,8,9,10,11,3,12,14,15,16,17,18,20,21,22,23,7,24,25,26,27,28,30,31,32,33,34,35,13,36,... 19 ... 29 ... 37 ...

Note that, in order
for everyone to stay peacefully in **S**,
only a few angry Primes (in yellow) have to jump elsewhere in search of a quite
neighborhood...

Best,

É.