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.

Original entry on oeis.org

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, 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, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Ctibor O. Zizka, Mar 18 2024

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Mathematica
    a[n_] := Mod[Times @@ IntegerDigits[n, 3], 3]; Array[a, 100, 0] (* Amiram Eldar, Mar 18 2024 *)
  • Python
    from functools import reduce
    from sympy.ntheory import digits
    def A371222(n): return reduce(lambda a,b: a*b%3,digits(n,3)[1:],1) # Chai Wah Wu, Mar 19 2024

Formula

a(n) = A309953(n) mod 3.
a(A081605(n)) = 0.