login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A361172 a(n) is the smallest positive number not among the terms between a(n-1) and the previous most recent occurrence of a(n-1) inclusive; if a(n-1) is a first occurrence, set a(n)=1; a(1)=1. 3
1, 1, 2, 1, 3, 1, 2, 4, 1, 3, 5, 1, 2, 6, 1, 3, 4, 7, 1, 2, 5, 8, 1, 3, 6, 9, 1, 2, 4, 10, 1, 3, 5, 7, 11, 1, 2, 6, 8, 12, 1, 3, 4, 9, 13, 1, 2, 5, 10, 14, 1, 3, 6, 7, 15, 1, 2, 4, 8, 11, 16, 1, 3, 5, 9, 12, 17, 1, 2, 6, 10, 13, 18, 1, 3, 4, 7, 14, 19, 1, 2, 5, 8, 15, 20, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
The terms between two adjacent 1s must be strictly increasing.
The index of first occurrences appears to be A060432 (partial sums of A002024).
LINKS
EXAMPLE
a(11)=5 because between a(10)=3 and the previous 3 (3, 1, 2, 4, 1, 3), the smallest missing number is 5, so a(11)=5.
PROG
(PARI) { pos = [0]; v = 1; for (n = 1, #a = vector(86), print1 (a[n] = v", "); v = 1; if (a[n] <= #pos && pos[a[n]], r = Set(a[pos[a[n]]..n]); while (setsearch(r, v), v++)); while (#pos < a[n], pos = concat(pos, vector(#pos)); ); pos[a[n]] = n; ); } \\ Rémy Sigrist, Mar 04 2023
CROSSREFS
Sequence in context: A057059 A368313 A346795 * A169896 A210208 A162306
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Mar 02 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 4 07:16 EDT 2024. Contains 372230 sequences. (Running on oeis4.)