login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Lexicographically earliest sequence of positive integers such that for any n > 0, the sum of the indices k < n such that a(k) = a(n) is less than or equal to n.
2

%I #9 Oct 17 2021 15:26:18

%S 1,1,1,2,2,1,3,3,2,4,4,1,5,5,3,6,6,2,7,7,4,8,8,1,9,9,5,10,10,3,11,11,

%T 6,12,12,2,13,13,7,14,14,4,15,15,8,16,16,1,17,17,9,18,18,5,19,19,10,

%U 20,20,3,21,21,11,22,22,6,23,23,12,24,24,2,25,25,13

%N Lexicographically earliest sequence of positive integers such that for any n > 0, the sum of the indices k < n such that a(k) = a(n) is less than or equal to n.

%C Every integer appears infinitely many times.

%C See table A348357 where the integers are arranged according to the present sequence.

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

%o (PARI) s=vector(25); for (n=1, 75, for (k=1, oo, if (s[k]<=n, print1 (k", "); s[k]+=n; break)))

%Y Cf. A098011, A348330, A348356, A348357.

%K nonn

%O 1,4

%A _Rémy Sigrist_, Oct 13 2021