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.

Showing 1-2 of 2 results.

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}.

A373099 Last digit of n*2^n + 1.

Original entry on oeis.org

1, 3, 9, 5, 5, 1, 5, 7, 9, 9, 1, 9, 3, 7, 7, 1, 7, 5, 3, 3, 1, 3, 9, 5, 5, 1, 5, 7, 9, 9, 1, 9, 3, 7, 7, 1, 7, 5, 3, 3, 1, 3, 9, 5, 5, 1, 5, 7, 9, 9, 1, 9, 3, 7, 7, 1, 7, 5, 3, 3, 1, 3, 9, 5, 5, 1, 5, 7, 9, 9, 1, 9, 3, 7, 7, 1, 7, 5, 3, 3
Offset: 0

Views

Author

Keywords

Comments

This is a cyclic sequence of 20 numbers, using only 1,3,5,7 and 9 (4 times each).

References

  • James Cullen, Question 15897, Educational Times, Vol. 58 (December 1905), p. 534.
  • Richard K. Guy (2004), Unsolved Problems in Number Theory (3rd ed.), New York: Springer Verlag, pp. section B20, ISBN 0-387-20860-7.

Crossrefs

Programs

  • Maple
    lastDigit := proc(n)
        return (n * 2^n + 1) mod 10;
    end proc:
    # Example usage
    minN := 1; maxN := 10;
    lastDigits := [seq(lastDigit(n), n = minN .. maxN)];
    print(lastDigits);
  • Mathematica
    lastDigit[n_] := Mod[n * 2^n + 1, 10]
    (* Example usage *)
    minN = 1; maxN = 10;
    lastDigits = Table[lastDigit[n], {n, minN, maxN}]
    Print[lastDigits]
  • PARI
    a(n) = lift(Mod(n*2^n + 1, 10))
  • Python
    def last_digit(n):
        return (n * 2**n + 1) % 10
    # Example usage
    min_n, max_n = 1, 10
    last_digits = [last_digit(n) for n in range(min_n, max_n + 1)]
    print(last_digits)
    

Formula

a(n) = A010879(A002064(n)).
From Chai Wah Wu, Jul 06 2024: (Start)
a(n) = a(n-2) - a(n-4) + a(n-5) + a(n-6) - a(n-7) - a(n-8) + a(n-9) - a(n-11) + a(n-13) for n > 12.
G.f.: (-3*x^12 - 3*x^11 - 2*x^10 - 4*x^9 + x^8 - 5*x^6 + 2*x^5 + 3*x^4 - 2*x^3 - 8*x^2 - 3*x - 1)/((x - 1)*(x^4 + x^3 + x^2 + x + 1)*(x^8 - x^6 + x^4 - x^2 + 1)). (End)
Showing 1-2 of 2 results.