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”).

A348331
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
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, 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, 20, 20, 3, 21, 21, 11, 22, 22, 6, 23, 23, 12, 24, 24, 2, 25, 25, 13
OFFSET
1,4
COMMENTS
Every integer appears infinitely many times.
See table A348357 where the integers are arranged according to the present sequence.
FORMULA
a(n) = 1 iff n belongs to A098011.
PROG
(PARI) s=vector(25); for (n=1, 75, for (k=1, oo, if (s[k]<=n, print1 (k", "); s[k]+=n; break)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Oct 13 2021
STATUS
approved