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.

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

This page as a plain text file.
%I A371222 #29 Mar 19 2024 17:22:58
%S A371222 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 A371222 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 A371222 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 A371222 Product of digits of (n written in base 3) mod 3.
%C A371222 a(A032924(n)) = 1 or 2. For n >= 1, a(A032924(n)) - 1 = A309953(A032924(n)) mod 3 - 1 = A010059(n+1).
%F A371222 a(n) = A309953(n) mod 3.
%F A371222 a(A081605(n)) = 0.
%e A371222 n = 5: 5_10 = 12_3 thus a(5) = 1*2 mod 3 = 2.
%e A371222 n = 8: 8_10 = 22_3 thus a(8) = 2*2 mod 3 = 1.
%t A371222 a[n_] := Mod[Times @@ IntegerDigits[n, 3], 3]; Array[a, 100, 0] (* _Amiram Eldar_, Mar 18 2024 *)
%o A371222 (Python)
%o A371222 from functools import reduce
%o A371222 from sympy.ntheory import digits
%o A371222 def A371222(n): return reduce(lambda a,b: a*b%3,digits(n,3)[1:],1) # _Chai Wah Wu_, Mar 19 2024
%Y A371222 Cf. A007089, A010059, A032924, A081605, A309953, A371281 (base 10).
%K A371222 nonn,base
%O A371222 0,3
%A A371222 _Ctibor O. Zizka_, Mar 18 2024