%I #10 Jul 14 2020 20:36:39
%S 1,2,3,2,4,3,5,6,3,7,8,5,4,6,9,10,4,11,8,6,4,5,12,7,13,6,5,14,11,15,7,
%T 5,9,16,8,10,17,6,18,11,19,9,8,6,7,10,12,20,21,16,8,7,22,17,23,10,18,
%U 24,7,9,25,11,26,13,27,7,8,20,9,14,12,28,11,29,8
%N Lexicographically earliest sequence of positive integers such that for any k > 0, there are k occurrences of k in the sequence, and the distance between any two occurrences of k is a multiple of k.
%C This sequence has similarities with A100795.
%H Rémy Sigrist, <a href="/A336215/b336215.txt">Table of n, a(n) for n = 1..10000</a>
%e For k = 1:
%e - we can set a(1) = 1,
%e For k = 2:
%e - we can set a(2) = a(4) = 2,
%e For k = 3:
%e - we can set a(3) = a(6) = a(9) = 3.
%e For k = 4:
%e - we can set a(5) = 4,
%e - however a(9) is already set to 3,
%e - so we continue with a(13) = a(17) = a(21) = 4.
%o (PARI) { v=1; for (n=1, #a=vector(75), if (!a[n], r=v; forstep (m=n, #a, v, if (!a[m], a[m]=v; if (!r--, break))); v++;); print1 (a[n]", ")) }
%Y Cf. A100795.
%K nonn,look
%O 1,2
%A _Rémy Sigrist_, Jul 12 2020