login
A234538
(Number of positive digits of n written in base 3) modulo 3.
1
0, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 0, 0, 2, 0, 0, 1, 2, 2, 2, 0, 0, 2, 0, 0, 1, 2, 2, 2, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 1, 0, 1, 1, 2, 0, 0, 0, 1, 1, 0, 1, 1, 1, 2, 2, 2, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 1, 0, 1, 1, 2, 0, 0, 0, 1, 1, 0, 1, 1, 1, 2, 2, 2, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 1, 0, 1, 1, 2, 0, 0, 0, 1, 1
OFFSET
0,5
COMMENTS
Since A000120 is the number of positive digits of n written in binary, this sequence is a formal ternary analog of the Thue-Morse sequence A010060. However, one cannot name it a "ternary version of A010060" like the known versions A053838, A071858, A036577-A036586, since it is not "cubefree"; i.e., it contains the same 3 consecutive terms, and there is not a known morphism for which it is a fixed point.
LINKS
FORMULA
A160384(n) == a(n) (mod 3).
MATHEMATICA
a[n_] := Mod[Plus @@ DigitCount[n, 3, {1, 2}], 3]; Array[a, 100, 0] (* Amiram Eldar, Jul 24 2023 *)
PROG
(PARI) a(n)=my(d=digits(n, 3)); sum(i=1, #d, !d[i])%3 \\ Charles R Greathouse IV, Jan 13 2014
KEYWORD
nonn,base,easy
AUTHOR
Vladimir Shevelev, Jan 13 2014
STATUS
approved