login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014391 Final digit of 8^n. 1

%I

%S 1,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,

%T 4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,

%U 6,8,4,2,6,8,4,2,6,8,4,2,6

%N Final digit of 8^n.

%H Vincenzo Librandi, <a href="/A014391/b014391.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1).

%F a(n) = 8^n mod 10. [_Zerinvary Lajos_, Nov 27 2009]

%F a(n) = (1/6)*(-(n mod 4)+8*((n+1) mod 4)+11*((n+2) mod 4)+2*((n+3) mod 4))-5*(C(2*n,n) mod 2). [_Paolo P. Lava_, Apr 16 2010]

%F G.f.: -(7*x - 3*x^2 + 5*x^3 + 1)/ ((x - 1)*(1 + x^2)). [_R. J. Mathar_, Apr 20 2010]

%F a(n) = +a(n-1) -a(n-2) +a(n-3). [_R. J. Mathar_, Apr 20 2010]

%t Table[PowerMod[8, n, 10], {n, 0, 200}] (* _Vladimir Joseph Stephan Orlovsky_, Jun 10 2011 *)

%t LinearRecurrence[{1,-1,1},{1,8,4,2},100] (* _Harvey P. Dale_, Jul 01 2019 *)

%o (Sage) [power_mod(8,n,10)for n in range(0,105)] # _Zerinvary Lajos_, Nov 27 2009

%o (PARI) a(n)=lift(Mod(8,10)^n) \\ _Charles R Greathouse IV_, Dec 29 2012

%o (MAGMA) [Modexp(8, n, 10): n in [0..100]]; // _Vincenzo Librandi_, Jun 30 2016

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 3 21:03 EDT 2021. Contains 346441 sequences. (Running on oeis4.)