login
Final 2 digits of 7^n.
4

%I #23 Sep 08 2022 08:44:39

%S 1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,

%T 43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,49,43,1,7,

%U 49,43,1,7,49,43,1,7,49,43,1,7

%N Final 2 digits of 7^n.

%H Vincenzo Librandi, <a href="/A014390/b014390.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) = 7^n mod 50. [_Zerinvary Lajos_, Nov 27 2009]

%t PowerMod[7,Range[0,70],100] (* _Harvey P. Dale_, Jan 23 2012 *)

%t LinearRecurrence[{1,-1,1},{1,7,49},70] (* _Harvey P. Dale_, May 09 2018 *)

%o (Sage) [power_mod(7,n,50)for n in range(0,80)] # _Zerinvary Lajos_, Nov 27 2009

%o (PARI) a(n)=lift(Mod(7,100)^n) \\ _Charles R Greathouse IV_, Jan 02 2013

%o (Magma) [Modexp(7, n, 100): n in [0..110]]; // _Vincenzo Librandi_, Aug 16 2016

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_.