A001903 Final digit of 7^n.
1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1, 7, 9, 3, 1
Offset: 0
Links
- Derek Orr, Table of n, a(n) for n = 0..1000
- Edward Omey and Stefan Van Gulck, What are the last digits of ...?, International Journal of Mathematical Education in Science and Technology, (2015) 46:1, 147-155.
- Index entries for sequences related to final digits of numbers
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1).
Programs
-
Magma
[7^n mod 10: n in [0..57]]; // Vincenzo Librandi, Feb 08 2011
-
Maple
A001903:=n->7^n mod 10: seq(A001903(n), n=0..100); # Wesley Ivan Hurt, Aug 12 2014
-
Mathematica
Table[PowerMod[7, n, 10], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *) LinearRecurrence[{1,-1,1},{1,7,9},100] (* or *) PadRight[{},100,{1,7,9,3}] (* Harvey P. Dale, May 21 2025 *)
-
PARI
a(n)=lift(Mod(7,10)^n) \\ Charles R Greathouse IV, Dec 28 2012
-
Sage
[power_mod(7,n,10)for n in range(0,81)] # Zerinvary Lajos, Nov 03 2009
Formula
a(n) = 7^n mod 10. - Zerinvary Lajos, Nov 03 2009
From R. J. Mathar, Apr 20 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n > 2.
G.f.: ( 1+6*x+3*x^2 ) / ( (1-x)*(1+x^2) ). (End)
a(n) = 10 - a(n-2) for n > 1. - Vincenzo Librandi, Feb 08 2011
From Bruno Berselli, Feb 08 2011: (Start)
a(n) = 5 - (2-i)*(-i)^n - (2+i)*i^n, where i=sqrt(-1).
E.g.f.: 2*sin(x) - 4*cos(x) + 5*exp(x). - Ilya Gutkovskiy, Jul 06 2016
Comments