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.

A371281 Last digit of the product of decimal digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 0, 2, 4, 6, 8, 0, 3, 6, 9, 2, 5, 8, 1, 4, 7, 0, 4, 8, 2, 6, 0, 4, 8, 2, 6, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 6, 2, 8, 4, 0, 6, 2, 8, 4, 0, 7, 4, 1, 8, 5, 2, 9, 6, 3, 0, 8, 6, 4, 2, 0, 8, 6, 4, 2, 0, 9, 8
Offset: 0

Views

Author

Ctibor O. Zizka, Mar 17 2024

Keywords

Comments

n=0 is taken as one 0 digit so that its product of digits is A007954(0) = 0.

Examples

			n = 15: a(15) = 1*5 mod 10 = 5.
n = 26: a(26) = 2*6 mod 10 = 2.
		

Crossrefs

Cf. A007954, A010879, A036987 (similar for 2 instead of 10), A053837.

Programs

  • Maple
    a:= n-> `if`(n<10, n, irem(n, 10, 'q')*a(q) mod 10):
    seq(a(n), n=0..92);  # Alois P. Heinz, Mar 17 2024
  • Mathematica
    a[n_] := Mod[Times @@ IntegerDigits[n], 10]; Array[a, 100, 0] (* Amiram Eldar, Mar 17 2024 *)
  • PARI
    a(n) = if (n==0, 0, vecprod(digits(n)) % 10); \\ Michel Marcus, Mar 17 2024
  • Python
    from math import prod
    def a(n): return prod(map(int, str(n)))%10
    print([a(n) for n in range(93)]) # Michael S. Branicky, Mar 17 2024
    

Formula

a(n) = A007954(n) mod 10.
a(n) = A010879(A007954(n)).