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.

A056849 Final digit of n^n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 30 2000

Keywords

Comments

Cyclic with a period of 20.
Also decimal expansion of 147656369016365674900/(10^20-1). - Bruno Berselli, Sep 27 2021

References

  • R. Euler and J. Sadek, "A Number That Gives The Units Of n^n", Journal of Recreational Mathematics, vol. 29(3), 1998, pp. 203-4.

Crossrefs

Programs

  • Magma
    [Modexp(n, n, 10): n in [1..100]]; // Bruno Berselli, Sep 27 2021
    
  • Maple
    seq(n &^ n mod 10, n=1..120);
  • Mathematica
    Table[PowerMod[n, n, 10], {n, 1, 100}]
  • PARI
    a(n)=lift(Mod(n,10)^n) \\ Charles R Greathouse IV, Dec 29 2012
    
  • Python
    def a(n): return pow(n, n, 10)
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Sep 13 2022

A204671 a(n) = n^n (mod 6).

Original entry on oeis.org

1, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4, 3, 4, 5, 0, 1, 4
Offset: 0

Views

Author

Keywords

Comments

For n>0, periodic with period 6 = A174824: repeat [1, 4, 3, 4, 5, 0].

Crossrefs

Programs

  • Magma
    [1] cat &cat [[1, 4, 3, 4, 5, 0]^^20]; // Wesley Ivan Hurt, Jun 23 2016
    
  • Maple
    A204671:=n->[1, 4, 3, 4, 5, 0][(n mod 6)+1]: 1, seq(A204671(n), n=0..100); # Wesley Ivan Hurt, Jun 23 2016
  • Mathematica
    Table[PowerMod[n,n,6], {n,0,140}]
    Join[{1},LinearRecurrence[{0, 0, 0, 0, 0, 1},{1, 4, 3, 4, 5, 0},86]] (* Ray Chandler, Aug 26 2015 *)
  • PARI
    a(n)=lift(Mod(n, 6)^n) \\ Andrew Howroyd, Feb 25 2018

Formula

G.f.: (x^6-5*x^5-4*x^4-3*x^3-4*x^2-x-1)/((x-1)*(x+1)*(x^2-x+1)*(x^2+x+1)). [Colin Barker, Jul 20 2012]
From Wesley Ivan Hurt, Jun 23 2016: (Start)
a(n) = a(n-6) for n>5.
a(0) = 1, a(n) = (17 - cos(n*Pi) - 8*cos(n*Pi/3) - 8*cos(2*n*Pi/3) - 4*sqrt(3)*sin(n*Pi/3) - 4*sqrt(3)*sin(2*n*Pi/3))/6 for n>0. (End)
a(n) = A010875(A000312(n)). - Michel Marcus, Jun 27 2016
Showing 1-2 of 2 results.