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.

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.

This page as a plain text file.
%I A353778 #25 Jul 01 2025 10:57:10
%S A353778 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,
%T A353778 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,
%U A353778 23,1,2,16,9,13,8,22,2,5,12,18,26,0,13,8,8,0
%N 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.
%C A353778 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.
%H A353778 Michael De Vlieger, <a href="/A353778/b353778.txt">Table of n, a(n) for n = 1..10000</a>
%e A353778 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.
%e A353778 a(25) is the first occurrence of 6, so a(26)=2 because two prior terms (9 and 11) are greater than 6.
%e A353778 a(37) is the second occurrence of 4, first seen at a(12), therefore a(38)=37-12-1=24.
%t A353778 Block[{a, c, k, m, s, nn}, nn = 81; c[_] = -1; a[1] = c[1] = 1; s = {}; Do[m = LengthWhile[s, # > a[i - 1] &]; Set[k, If[c[#] == -1, m, i - c[#] - 1]] &@ a[i - 1]; Set[{a[i], c[a[i - 1]]}, {k, i}]; s = Insert[s, a[i - 1], 1 + m], {i, 2, nn}]; Array[a, nn] ] (* _Michael De Vlieger_, May 08 2022 *)
%Y A353778 Cf. A328096.
%K A353778 nonn
%O A353778 1,6
%A A353778 _David James Sycamore_, May 07 2022