cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A234538 (Number of positive digits of n written in base 3) modulo 3.

This page as a plain text file.
%I A234538 #39 Jul 24 2023 02:36:21
%S A234538 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,
%T A234538 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,
%U A234538 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
%N A234538 (Number of positive digits of n written in base 3) modulo 3.
%C A234538 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.
%H A234538 Peter J. C. Moses, <a href="/A234538/b234538.txt">Table of n, a(n) for n = 0..999</a>
%F A234538 A160384(n) == a(n) (mod 3).
%t A234538 a[n_] := Mod[Plus @@ DigitCount[n, 3, {1, 2}], 3]; Array[a, 100, 0] (* _Amiram Eldar_, Jul 24 2023 *)
%o A234538 (PARI) a(n)=my(d=digits(n, 3)); sum(i=1, #d, !d[i])%3 \\ _Charles R Greathouse IV_, Jan 13 2014
%Y A234538 Cf. A000120, A010060, A036577-A036586, A053838, A071858, A160384.
%K A234538 nonn,base,easy
%O A234538 0,5
%A A234538 _Vladimir Shevelev_, Jan 13 2014