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.

A373098 Last digit of n*2^n.

Original entry on oeis.org

0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2
Offset: 0

Views

Author

Keywords

Comments

Periodic with period 20: [0,2,8,4,4,0,4,6,8,8,0,8,2,6,6,0,6,4,2,2].

Crossrefs

Programs

  • Maple
    a:= n-> n*2&^n mod 10:
    seq(a(n), n=0..100);
  • Mathematica
    a[n_] := Mod[n*2^n, 10]
  • PARI
    a(n,b=10) = lift(n*Mod(2,b)^n) \\ Hugo Pfoertner, May 24 2024
  • Python
    def a(n):
        return (n * 2**n) % 10
    

Formula

a(n) = A010879(A036289(n)).
a(n) = A373099(n) - 1.
a(n) = A373100(n) + 1 (n >= 1).
a(n) = 0 if n mod 5 = 0,
2 if n mod 20 = {1, 12, 18, 19},
8 if n mod 20 = {2, 8, 9, 11},
4 if n mod 20 = {3, 4, 6, 17},
6 if n mod 20 = {7, 13, 14, 16}.