[seqfan] Re: The Annoyance Sequence
mike at vincico.com
mike at vincico.com
Sun Jul 16 17:56:28 CEST 2023
Not sure this sequence matches Ali's original definition, because I have
different terms. I will label this sequence "s20230716" in case someone
wants to refer to it.
Using a definition as follows:
Let w = N, the set of nonzero positive numbers.
Set a(n) = j = w(1).
Drop the first term in w.
Then we "annoy" j numbers in the following manner:
Set k = w(1).
Move w(1) to w(k). Move/"annoy" means, delete w(1) = k and insert k in the
k-th place in w.
Then the sequence s20230716 begins as follows:
1, 3, 5, 7, 6, 2, 8, 11, 21, 10, 4, 14, 9, 12, 15, 44, 13, 33, 32, 26, 16,
27, 47, 40, 39, 36, 30, 42, 65, 19, 45, 73, 23, 17, 60, 20, 64, 80, 94, 31,
71, 49, 29, 55, 85, 134, 61, 70, 34, 107, 76, 159, 57, 53, 54, 110, 67, 62,
63, 135, 101, 24, 22, 52, 111, 150, 98, 132, 25, 38, 46, 198, 28, 127, 96,
...
In this manner we lock in values once they've had their turn. The terms in w
are still shifting. Once a number has had its turn it's frozen and can't be
used, so it's a permutation of natural numbers. Now how many times does a
given number get kicked around? Maybe that's also interesting. Are the
numbers that are late in the sequence "particularly perturbed"?
Using the following Mathematica:
nn = 120;
w = Range[nn]; s = nn + 1;
Do[Set[{a[n], j}, {#, #} &@ First[w]]; w = w[[2 ;; -1]];
Do[k = First[w];
If[k > #, w = Join[w, Range[s, s + k - #] ]; s += k - # + 1] &[
Length[w]];
w = Insert[w[[2 ;; -1]], k, k],
{i, j}],
{n, nn}];
Array[a, nn]
In the program we manage (finite) w such that, if we have k > length of w,
we add more terms as necessary so as to extend finite w as if it were
infinite. We want a finite list to be as small as possible to reduce memory
and computation time. (As an aside, I don't like redefining lists but it's
Sunday morning and I can't dream of a way not to do this, because this
program could be faster if such might be avoided. Then shifting ranges of
values in a dimensioned variable would seem about as ponderous. This might
be MUCH faster in Python or c++, and it ever makes me jealous.)
This (s20230716b) is the reverse permutation:
1, 6, 2, 11, 3, 5, 4, 7, 13, 10, 8, 14, 17, 12, 15, 21, 34, 84, 30, 36, 9,
63, 33, 62, 69, 20, 22, 73, 43, 27, 40, 19, 18, 49, 104, 26, 166, 70, 25,
24, 76, 28, 105, 16, 31, 71, 23, 80, 42, 128, 135, 64, 54, 55, 44, 110, 53,
101, 268, 35, 47, 58, 59, 37, 29, 114, 57, 159, 212, 48, 41, 116, 32, 91,
96, ...
The "chill" numbers, those that are not that annoyed, (meaning the
"earliest", or local maxima s20230716r) are the following:
1, 3, 5, 7, 8, 11, 21, 44, 47, 65, 73, 80, 94, 134, 159, 198, 290, 437, 489,
552, 625, 700, 814, 886, 1334, 1660, 1693, 1745, 1869, 2091, 2546, 2625,
2696, 2814, 2991, 3009, 4764, 5041, 5499, 5561, ...
Are they really so chill? Meaning have they really never moved, or maybe
they ended up lucky even after they moved, it's just that other numbers
moved from a position ahead of them before they got locked in.
The late numbers (poor schmucks out of luck, local minima s20230716s that
set records in a(n) - n) are the following:
1, 2, 4, 19, 17, 24, 22, 25, 28, 18, 35, 50, 51, 68, 37, 69, 59, 102, 119,
114, 112, 104, 140, 157, 165, 117, 161, 247, 264, 336, 338, 286, 237, ...
They started in a place in line but when came time to lock in (say, enter
the restaurant, ride the roller coaster, or whatever), they were later than
they started (except for 1, which is a trivial case). So they are probably
pretty annoyed. Are they _particularly_ annoyed?
Fixed points begin {1, 10, 15, 581, ...}. Aside from 1, they might have been
jostled around but happened to return to their chair after being annoyed.
Why these numbers?
I have installed an "annoyance detection counter".
Now if it's working, this is the sequence s20230716c of how annoyed a number
has been (meaning how many times it has moved, not counting how they have
been promoted by some number earlier in the sequence having had to move
behind in line):
0, 13, 0, 18, 0, 1, 0, 1, 8, 4, 1, 6, 11, 3, 5, 15, 44, 272, 30, 40, 0, 124,
29, 111, 129, 6, 7, 123, 37, 11, 29, 3, 2, 41, 218, 7, 559, 76, 5, 4, 81, 6,
172, 0, 7, 59, 2, 76, 15, 226, 255, 39, 27, 27, 13, 142, 23, 110, 918, 5,
14, 24, 24, 5, 2, 121, 20, 262, 473, ...
nn = 2^10; c[_] := 0;
w = Range[nn]; s = nn + 1;
Do[Set[{a[n], j}, {#, #} &@ First[w]]; w = w[[2 ;; -1]];
Do[k = First[w]; c[k]++;
If[k > #, w = Join[w, Range[s, s + k - #]]; s += k - # + 1] &[
Length[w]];
w = Insert[w[[2 ;; -1]], k, k], {i, j}],
{n, nn}];
Do[b[a[i]] = i, {i, nn}];
Array[c, nn]
The annoyance detection counter is "c" in the above code, whereas b =
s20230716b
Then the particularly perturbed numbers (those that set records for how many
times they had to move) begin as follows (but I have to find a way to ensure
I have locked in the values, this was done fast):
1, 2, 4, 17, 18, 37, 59, ...
And it seems that numbers that appear late are distinct from particularly
perturbed ones. They were late as a matter of circumstance, meaning that
other numbers cut back into line before them (which of course is annoying,
but not in the same sense as the definition of the sequence). Were those
other numbers smaller?
We can ascertain the particularly annoyed numbers only when they have been
locked in.
Then the true chill numbers are thus those who never moved; they just
watched other numbers have to move. These are zeros in s20230716c:
1, 3, 5, 7, 21, 44, ...
Why these numbers?
Therefore maybe there might be several interesting variants of the idea.
(Hope I haven't annoyed you!)
Best regards,
Mike
-----Original Message-----
From: SeqFan <seqfan-bounces at list.seqfan.eu> On Behalf Of Yifan Xie
Sent: Sunday, 16 July, 2023 01:20
To: SequenceFansMailingList <seqfan at list.seqfan.eu>
Subject: [seqfan] Re: The Annoyance Sequence
First of all, your sequence looks wrong: At the first turn, 2 is annoyed; At
the second turn, 3 is not annoyed.
Maybe you can change the definition to:
For the nth turn, find the smallest number x which all the numbers behind
it's position is not changed. a(x-1) numbers are annoyed.
Example:
1->
(first turn)1,3,4,2->
(second turn)1,3,4,2,6,7,8,9,10,5->1,3,4,2,7,8,9,10,5,11,6->
(third turn) 6 numbers starting from 12 are annoyed.
Best regards,
Yifan Xie
(xieyifan4013 at 163.com)
| |
xieyifan4013 at 163.com
|
|
Email:xieyifan4013 at 163.com
|
---- Replied Message ----
| From | Ali Sada via SeqFan<seqfan at list.seqfan.eu> | Date | 07/16/2023
| 09:34 | To | Sequence Fanatics Discussion List<seqfan at list.seqfan.eu>
| | Cc | Ali Sada<pemd70 at yahoo.com> | Subject | [seqfan] The Annoyance
| Sequence |
Hi everyone,
We start with the list of positive integers 1,2,3,4,....When it turn comes,
a(n) can annoy a(n) numbers and force them to jump to the right and insert
themselves. When annoyed, the number m can jump m steps.
We start with a(1) =1. The 1 can annoy only 1 number, 2. The 2 jumps 2 steps
and the list becomes 1,3,4,2,5,6,7,8,9...Now, a(2) = 3. It annoys 3 numbers
and force them to jump First, the 4 jumps 4 steps 1,3,2,5,6,7,4,8,9Then the
2 jumps 2 steps 1,3,5,6,2,7,4,8,9Finally, the 5 jumps 5 steps
1,3,6,2,7,4,8,5,9At this stage, 3 finished its annoyance and a(3) = 6, which
in turn annoys 6 numbers and so on.
The resulted sequence is
1, 3, 6, 2, 10, 9, 5, 8, 22, 4, 13, 15, 20, 29, 7, 12, 18, 32,59, 50, 19,
31, 14, 81, 16, 90, 17, 25, 78, 83, 21, 46, 65, 23, 41, 71, 64, 36,53, 47,
58, 44, 35, 76, 62, 43, 88, 49, 123, 116, 27, 111, 40, 11, 69, 30, 79,
102,24, 60, 159, 73, 248, 72, 55, 185, 45, 101, 38, 95, 141 I would really
appreciate any help defining this sequence, if it were suitable for the
OEIS. Note: Maybe the VBA/Excel program below explains the sequence better
Sub Annoyance()
For i = 1 To 1000
Cells(1, i) = i
Next iFor i1 = 1 To 71 k1 = Cells(1, i1)
For i2 = i1 + 1 To i1 + k1
k2 = Cells(1, i1 + 1)
For i3 = i1 + 1 To i1 + k2
Cells(1, i3) = Cells(1, i3 + 1)
Next i3
Cells(1, i1 + k2 + 1) = k2
Next i2
Next i1
End Sub
Best,
Ali
--
Seqfan Mailing list - http://list.seqfan.eu/
--
Seqfan Mailing list - http://list.seqfan.eu/
More information about the SeqFan
mailing list