OFFSET
1,2
COMMENTS
A 4-ary sequence is a sequence in which every term is 0, 1, 2 or 3.
Define the difference sequence of a 4-ary sequence (x(1), ..., x(n)) as (|x(1) - x(2)|, |x(2) - x(3)|, ..., |x(n-1) - x(n)|). The difference operation is similar to the Ducci game, except that there is no |x(n) - x(1)| term.
For a 4-ary sequence S of length n, take its difference sequence n-1 times, and the remaining number is the characteristic value of S.
LINKS
Yifan Xie, Python program
FORMULA
a(n) = 2*4^(n-1) - A396251(n).
a(n) <= n^2 * 2^n.
EXAMPLE
For n = 2, the a(2) = 4 sequences are (0, 2), (1, 3), (2, 0) and (3, 1).
CROSSREFS
KEYWORD
nonn,more,new
AUTHOR
Yifan Xie, May 31 2026
EXTENSIONS
a(21) from Sean A. Irvine, Jun 15 2026
STATUS
approved
