cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A361172 #29 Mar 06 2023 20:13:04
%S A361172 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,
%T A361172 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,
%U A361172 9,12,17,1,2,6,10,13,18,1,3,4,7,14,19,1,2,5,8,15,20,1
%N 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.
%C A361172 The terms between two adjacent 1s must be strictly increasing.
%C A361172 The index of first occurrences appears to be A060432 (partial sums of A002024).
%H A361172 Neal Gersh Tolunsky, <a href="/A361172/b361172.txt">Table of n, a(n) for n = 1..10000</a>
%H A361172 Neal Gersh Tolunsky, <a href="/A361172/a361172.png">Scatterplot of the first 13158 terms</a>
%e A361172 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.
%o A361172 (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
%Y A361172 Cf. A060432, A358921, A361101.
%K A361172 nonn
%O A361172 1,3
%A A361172 _Neal Gersh Tolunsky_, Mar 02 2023