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.

A341846 a(1) = 0; thereafter, if a(n) has not appeared before, a(n+1) = number of existing terms which are greater than a(n); otherwise, a(n) = n-m where a(m) is the most recent copy of a(n).

This page as a plain text file.
%I A341846 #16 Mar 28 2021 19:34:05
%S A341846 0,0,1,0,2,0,2,2,1,6,0,5,1,4,2,7,0,6,8,0,3,6,4,9,0,5,14,0,3,8,11,1,19,
%T A341846 0,6,13,2,22,0,5,14,14,1,11,13,9,22,9,2,12,8,21,2,4,31,0,17,5,18,5,2,
%U A341846 8,11,19,31,10,18,8,6,34,0,15,11,10,8,7,60,0,7
%N A341846 a(1) = 0; thereafter, if a(n) has not appeared before, a(n+1) = number of existing terms which are greater than a(n); otherwise, a(n) = n-m where a(m) is the most recent copy of a(n).
%C A341846 The sequence is nontrivial only with a(1) = 0 or 1. a(1)=0 here for contrast with the Van Eck sequence A181391, with which data agrees up to a(12). For n > 1, a(n)=0 if and only if a(n-1) is a record novel term, whereas every non-record novel term is followed by a term > 0. Definition implies a(n) < n for all n. Open questions: Is it true that a(n) + a(n+1) < n for all n? (This is true for n <= 65000.) Do records ever arise from rule 1? Does every number appear? (If so, 0 appears infinitely many times.)
%H A341846 Michael De Vlieger, <a href="/A341846/b341846.txt">Table of n, a(n) for n = 1..10001</a>
%H A341846 Michael De Vlieger, <a href="/A341846/a341846.png">Scatterplot of a(n)</a> for 1 <= n <= 4096, color coded to show records in red, zeros in blue, terms instigated by novel a(n) in green, and records in the last-mentioned terms in orange. The least unused number is indicated by a yellow step function line.
%H A341846 Michael De Vlieger, <a href="/A341846/a341846_1.png">Plot of b(n) = a(n) + a(n+1)</a> for 1 <= n <= 65536 showing a partial bifurcation resulting from conditions involving novel a(n+1) such that, for such conditions, b(n) > n/Pi.
%H A341846 Michael De Vlieger, <a href="/A341846/a341846_2.png">Logarithmic scatterplot of a(n)</a> for 1 <= n <= 65536.
%e A341846 a(2)=0 because a(1)=0 is a novel term, and there are 0 terms > 0.
%e A341846 a(3)=1 because a(2) has been seen before at a(1), and 2-1=1.
%e A341846 a(13)=1, because a(12)=5, a novel term with 1 earlier term (a(10)=6) greater than it.
%t A341846 Block[{nn = 120, a = {0}, c}, Do[If[IntegerQ@ c[#], AppendTo[a, i - c[#] ]; Set[c[#], i], Set[c[#], i]; AppendTo[a, Count[Most@ a, _?(# > a[[-1]] &)]]] &[ a[[-1]] ], {i, nn}]; a] (* _Michael De Vlieger_, Feb 21 2021 *)
%o A341846 (Python)
%o A341846 def aupton(terms):
%o A341846   alst, an = [], 0
%o A341846   for n in range(1, terms+1):
%o A341846     if an not in alst: anp1 = sum(ai > an for ai in alst)
%o A341846     else: anp1 = alst[::-1].index(an) + 1
%o A341846     alst, an = alst + [an], anp1
%o A341846   return alst
%o A341846 print(aupton(79)) # _Michael S. Branicky_, Feb 21 2021
%Y A341846 Cf. A181391.
%K A341846 nonn
%O A341846 1,5
%A A341846 _David James Sycamore_, Feb 19 2021