%I #42 Dec 20 2024 12:36:19
%S 3,9,13,17,23,27,33,37,43,47,51,57,61,67,71,75,81,85,91,95,99,105,109,
%T 115,119,125,129,133,139,143,149,153,157,163,167,173,177,183,187,191,
%U 197,201,207,211,215,221,225,231,235,241,245,249,255,259,265,269,273,279,283,289,293,297
%N Start with list L = 1,2,3,4,.... For n = 1,2,3,..., iterate as follows: let j = L(1) and k = L(j+1), get a(n) = j + k, and remove j and k from L.
%C The first differences could be related to A004641. (From _Bradley Klee_ via Seqfan list.)
%C The first differences appear to always be 4 or 6. The relationship A363406(n) - A363406(n-1) = 6 iff A004641(n-1) = 1 first fails at n = 50. - _Michael S. Branicky_, Dec 20 2024
%H Michael S. Branicky, <a href="/A363406/b363406.txt">Table of n, a(n) for n = 1..10000</a>
%e Starting with L = 1,2,3,4,..., the values of j, k, and a(n) are computed (and L is updated) as follows:
%e n j k a(n) L
%e = = = ==== ======================================================
%e - - - - 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
%e 1 1 2 3 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
%e 2 3 6 9 4,5, 7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
%e 3 4 9 13 5, 7,8, 10,11,12,13,14,15,16,17,18,19,20,...
%e 4 5 12 17 7,8, 10,11, 13,14,15,16,17,18,19,20,...
%e 5 7 16 23 8, 10,11, 13,14,15, 17,18,19,20,...
%e 6 8 19 27 10,11, 13,14,15, 17,18, 20,...
%o (MATLAB)
%o function a = A363406( max_n )
%o L = [1:max_n+2];
%o for n = 1:max_n
%o a(n) = L(1) + L(L(1)+1); l = L(end);
%o L = [L(2:L(1)) L(L(1)+2:end)];
%o L = [L 1+l:1+l+L(1)];
%o end
%o end % _Thomas Scheuerle_, Jun 01 2023
%o (Python)
%o from itertools import islice
%o def agen(): # generator of terms
%o L = list(range(1, 10))
%o while True:
%o j = L[0]
%o k = L[j]
%o yield j + k # an
%o L.remove(j)
%o L.remove(k)
%o L.extend(list(range(L[-1]+1, L[-1]+7)))
%o print(list(islice(agen(), 62))) # _Michael S. Branicky_, Dec 20 2024
%Y Cf. A004641.
%K nonn
%O 1,1
%A _Ali Sada_ and _David James Sycamore_, May 31 2023