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.

Showing 1-2 of 2 results.

A328342 a(0) = 0; for n > 1, if a(n-1) has appeared three or more times then a(n) = total number of terms between the last and second-last appearance of a(n-1), minus the total number of terms between the second-last and third-last appearance of a(n-1). If a(n-1) has appeared two times, a(n) = total number of terms between the last and second-last appearance of a(n-1). If a(n-1) has appeared once, a(n) = 0.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 1, -2, 0, 1, 2, 7, 0, 0, -3, 0, 1, 4, 0, 1, -4, 0, 0, -2, 16, 0, 2, 9, 0, 0, -2, -9, 0, 2, -9, 3, 0, 1, 15, 0, -1, 0, -1, 2, 3, 9, 18, 0, 4, 31, 0, -3, 37, 0, 0, -2, 18, 10, 0, 3, 6, 0, -1, 18, -3, -24, 0, 2, 14, 0, -2, -10, 0, 0, -2, -11, 0, 2, -14
Offset: 0

Views

Author

Scott R. Shannon, Oct 12 2019

Keywords

Comments

For the first 10 million terms the largest positive value is 9845628 while the largest negative value is -9748780. The largest positive term that has not appeared is 30832 and the largest negative term that has not appeared is -33426. It is likely that all integers eventually appear in the sequence, although this is unproven.

Examples

			a(1) = 0 as a(1-1) = a(0) = 0 has only appeared once.
a(2) = 1 as a(2-1) = a(1) = 0 has appeared twice, and the number of terms between the last and second-last appearance of 0, a(0) and a(1), is 1
a(4) = 1. a(4-1) = a(3) = 0, which has appeared three times. The number of terms between the last and second-last appearance of 0, a(3) and a(1), is 2. The number of terms between the second-last and third-last appearance of 0, a(1) and a(0), is 1. Thus a(4) = 2 - 1 = 1.
a(9) = -2. a(9-1) = a(8) = 1, which has appeared three times. The number of terms between the last and second-last appearance of 1, a(8) and a(7), is 1. The number of terms between the second-last and third-last appearance of 1, a(7) and a(4), is 3. Thus a(9) = 1 - 3 = -2.
		

Crossrefs

Programs

A353778 a(1)=1. If a(n) is a novel term (seen for first time), a(n+1) = number of prior terms a(j) > a(n), 1 <= j <= n-1. If a(n) is a repeat of a term last seen at a(m), m < n, then a(n+1) = n-m-1.

Original entry on oeis.org

1, 0, 1, 1, 0, 2, 0, 1, 3, 0, 2, 4, 0, 2, 2, 0, 2, 1, 9, 0, 3, 11, 0, 2, 6, 2, 1, 8, 2, 2, 0, 7, 3, 11, 11, 0, 4, 24, 0, 2, 9, 21, 1, 15, 2, 4, 8, 18, 2, 3, 16, 3, 1, 9, 12, 5, 16, 5, 1, 5, 1, 1, 0, 23, 1, 2, 16, 9, 13, 8, 22, 2, 5, 12, 18, 26, 0, 13, 8, 8, 0
Offset: 1

Views

Author

David James Sycamore, May 07 2022

Keywords

Comments

a(n) <= n for all n, with equality when n=1. Similar to A328096 initially, because novel terms are all records to begin with, but diverges when non-record novel terms appear, which produce nonzero following terms.

Examples

			a(1)=1 is a novel record term, hence a(2)=0. a(3)=1 because a(2)=0 is a novel (non-record) term and only one term, a(1), exceeds it.
a(25) is the first occurrence of 6, so a(26)=2 because two prior terms (9 and 11) are greater than 6.
a(37) is the second occurrence of 4, first seen at a(12), therefore a(38)=37-12-1=24.
		

Crossrefs

Cf. A328096.

Programs

Showing 1-2 of 2 results.