A234538 (Number of positive digits of n written in base 3) modulo 3.
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
Links
- Peter J. C. Moses, Table of n, a(n) for n = 0..999
Programs
-
Mathematica
a[n_] := Mod[Plus @@ DigitCount[n, 3, {1, 2}], 3]; Array[a, 100, 0] (* Amiram Eldar, Jul 24 2023 *)
-
PARI
a(n)=my(d=digits(n, 3)); sum(i=1, #d, !d[i])%3 \\ Charles R Greathouse IV, Jan 13 2014
Formula
A160384(n) == a(n) (mod 3).
Comments