login
A367746
a(1) = 0, a(2) = 1. For n > 2, if a(n-1) is a novel term, a(n) = |a(n-1) - a(n-2) + 1|, else if a(n-1) is a repeat term, last seen at a(m), a(n) = n-m-1.
1
0, 1, 2, 2, 0, 3, 4, 2, 3, 2, 1, 8, 8, 0, 8, 1, 4, 9, 6, 2, 9, 2, 1, 6, 4, 7, 4, 1, 4, 1, 1, 0, 17, 18, 2, 12, 11, 0, 5, 6, 15, 10, 4, 13, 10, 2, 10, 1, 16, 16, 0, 12, 15, 11, 16, 4, 12, 4, 1, 10, 12, 3, 52, 50, 1, 5, 26, 22, 3, 6, 29, 24, 4, 14, 11, 20, 10, 16, 22, 10, 2, 34, 33
OFFSET
1,3
COMMENTS
The definition is similar to those of A181391 and A341094.
a(n) < n for all n follows from the definition.
2 seems to be the most frequently occurring term (51470 times in the first 16*10^6 terms).
In general a zero term occurs in two distinct ways: (i). Subsequent to 1,k where 1 is a repeat term and k is novel, which leads to 1,k,k then 0; (ii). k, k-1 where k-1 is novel. The former seems to happen much more frequently than the latter.
Conjecture: all numbers eventually appear.
Open questions: Does every number which occurs, occur again? Why is 2 the most frequently occurring term? Does 0 occur infinitely many times?
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16, showing records in red and representing zeros instead as 1/2.
EXAMPLE
a(1,2) = 0,1 and since 1 is novel a(3) = |1-0+1| = 2.
Since a(3) = 2 is a novel term, a(4) = |2-1+1| = 2.
a(3,4) = 2,2 implies a(5) = 0.
a(36,37) = 12,11 and since 11 is novel, a(38) = |11-12+1| = 0.
a(23,24,25,26,27,28,29,30,31,32) = 1,6,4,7,4,1,4,1,1,0 (1,4 are repeat terms, 7 is novel). This is an exceptional occurrence of 0 outside the two categories mentioned in Comments. It is not known if there are other exceptions.
MATHEMATICA
c[_] := 0; nn = 2^26 + 1; a[1] = i = 0; a[2] = j = 1; c[0] = 1;
Do[If[c[j] <= 0,
k = Abs[j - i + 1],
k = n - c[j] - 2];
Set[{a[n], c[j], i, j}, {k, n - 1, j, k}], {n, 3, nn}];
Array[a, nn] (* Michael De Vlieger, Dec 14 2023 *)
CROSSREFS
Sequence in context: A324657 A369524 A339422 * A094053 A294598 A077264
KEYWORD
nonn
AUTHOR
STATUS
approved