login
Lexicographically earliest sequence of positive integers such that for any m > 0, gaps between consecutive m's are all distinct.
8

%I #15 May 03 2020 16:25:27

%S 1,1,2,1,2,2,1,3,2,3,1,4,2,3,3,1,4,2,4,3,5,1,3,2,4,4,5,5,1,3,2,5,4,5,

%T 6,3,1,6,2,6,4,5,7,3,4,1,5,2,6,5,7,7,3,4,6,1,4,2,5,6,6,7,3,7,6,5,1,4,

%U 2,7,8,6,7,3,8,5,7,4,1,6,2,7,8,8,9,3,5

%N Lexicographically earliest sequence of positive integers such that for any m > 0, gaps between consecutive m's are all distinct.

%C Every positive integer appears infinitely many times in the sequence.

%C This sequence has similarities with A003602, where gaps between consecutive equal values are all distinct.

%C This sequence has similarities with A002260, where for any m > 0, gaps between consecutive m's are strictly increasing.

%C Apparently, for any m > 0:

%C - the k-th gap between consecutive m's equals k except for finitely many k's,

%C - the k-th occurrence of m appears at index A330897(m) + A000217(k-1) except for finitely many k's.

%H Rémy Sigrist, <a href="/A330896/b330896.txt">Table of n, a(n) for n = 1..10000</a>

%H Rémy Sigrist, <a href="/A330896/a330896.gp.txt">PARI program for A330896</a>

%F a(n) = 1 iff n belongs to A000124.

%e The first terms, alongside the gaps for m = 1..4, are:

%e n| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ...

%e a(n)| 1 1 2 1 2 2 1 3 2 3 1 4 2 3 3 1 4 2 4 3 5 1 3 ...

%e ----+---------------------------------------------------------------------

%e 1's| 1, 2, 3, 4, 5, 6, ...

%e 2's| 2, 1, 3, 4, 5, ...

%e 3's| 2, 4, 1, 5, 3, ...

%e 4's| 5, 2, ...

%o (PARI) See Links section.

%Y Cf. A000124, A000217, A002260, A003602, A330897.

%K nonn,look

%O 1,3

%A _Rémy Sigrist_, May 01 2020