login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Product of digits of (n written in base 3) mod 3.
1

%I #29 Mar 19 2024 17:22:58

%S 0,1,2,0,1,2,0,2,1,0,0,0,0,1,2,0,2,1,0,0,0,0,2,1,0,1,2,0,0,0,0,0,0,0,

%T 0,0,0,0,0,0,1,2,0,2,1,0,0,0,0,2,1,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,

%U 1,0,1,2,0,0,0,0,1,2,0,2,1,0,0,0,0,0,0,0,0,0,0,0

%N Product of digits of (n written in base 3) mod 3.

%C a(A032924(n)) = 1 or 2. For n >= 1, a(A032924(n)) - 1 = A309953(A032924(n)) mod 3 - 1 = A010059(n+1).

%F a(n) = A309953(n) mod 3.

%F a(A081605(n)) = 0.

%e n = 5: 5_10 = 12_3 thus a(5) = 1*2 mod 3 = 2.

%e n = 8: 8_10 = 22_3 thus a(8) = 2*2 mod 3 = 1.

%t a[n_] := Mod[Times @@ IntegerDigits[n, 3], 3]; Array[a, 100, 0] (* _Amiram Eldar_, Mar 18 2024 *)

%o (Python)

%o from functools import reduce

%o from sympy.ntheory import digits

%o def A371222(n): return reduce(lambda a,b: a*b%3,digits(n,3)[1:],1) # _Chai Wah Wu_, Mar 19 2024

%Y Cf. A007089, A010059, A032924, A081605, A309953, A371281 (base 10).

%K nonn,base

%O 0,3

%A _Ctibor O. Zizka_, Mar 18 2024