|
|
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).
|
|
2
|
|
|
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, 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, 8, 11, 19, 31, 10, 18, 8, 6, 34, 0, 15, 11, 10, 8, 7, 60, 0, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,5
|
|
COMMENTS
|
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.)
|
|
LINKS
|
Michael De Vlieger, Scatterplot of a(n) 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.
Michael De Vlieger, Plot of b(n) = a(n) + a(n+1) 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.
|
|
EXAMPLE
|
a(2)=0 because a(1)=0 is a novel term, and there are 0 terms > 0.
a(3)=1 because a(2) has been seen before at a(1), and 2-1=1.
a(13)=1, because a(12)=5, a novel term with 1 earlier term (a(10)=6) greater than it.
|
|
MATHEMATICA
|
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 *)
|
|
PROG
|
(Python)
def aupton(terms):
alst, an = [], 0
for n in range(1, terms+1):
if an not in alst: anp1 = sum(ai > an for ai in alst)
else: anp1 = alst[::-1].index(an) + 1
alst, an = alst + [an], anp1
return alst
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|