OFFSET
0,3
COMMENTS
Is a(n+1)-a(n) always 0 or 1?
Consider a pair of sequences b and c defined in the following manner:
- b(n) is the number of coincidences of the first n terms of sequences b and c,
- c(n) is the number of coincidences of the first n terms of sequence b and the first n terms of sequence c in reverse order.
(The sequences are "self-starting" with no initial values required, because for n = 0 there are obviously no coincidences, so b(0) = c(0) = 0.) For each of b and c, we may or may not allow circular shifts and maximize the number of coincidences over all such shifts, so there are four versions:
- Shifts in c and either shifts or no shifts in b: In both these cases, b and c are the following sequences, which are constant from n = 5 and n = 7, respectively:
b: 0, 1, 2, 3, 3, 4, 4, 4, 4, 4, ...
c: 0, 1, 2, 1, 3, 2, 2, 3, 3, 3, ...
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 0..20000
EXAMPLE
The first time the shift comes into play is for n = 21. The first 21 terms of this sequence and of A380189 are:
0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 3, 1, 0, 2, 0, 2, 2, 2, 2, 3, 3
^ ^ ^ ^
with only 4 coincidences. But if the second row is shifted 7 steps to the right, we get:
0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
0, 2, 2, 2, 2, 3, 3, 0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 3, 1, 0, 2
^ ^ ^ ^ ^
with 5 coincidences. This is the best possible, so a(21) = 5.
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Pontus von Brömssen, Jan 15 2025
STATUS
approved