login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = 7^n mod 25.
1

%I #41 Jan 07 2024 13:04:01

%S 1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,

%T 18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,

%U 24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18,1,7,24,18

%N a(n) = 7^n mod 25.

%H G. C. Greubel, <a href="/A070410/b070410.txt">Table of n, a(n) for n = 0..1000</a>

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

%F From _R. J. Mathar_, Apr 20 2010: (Start)

%F a(n) = a(n-1) - a(n-2) + a(n-3).

%F G.f.: ( -1-6*x-18*x^2 ) / ( (x-1)*(1+x^2) ). (End)

%F a(n) = 25 - a(n-2), n>=2. - _Vincenzo Librandi_, Feb 08 2011

%F From _G. C. Greubel_, Mar 20 2016: (Start)

%F a(n) = a(n-4).

%F E.g.f.: (1/2)*(25*exp(x) - 23*cos(x) - 11*sin(x)). (End)

%t PowerMod[7, Range[0, 50], 25] (* _G. C. Greubel_, Mar 20 2016 *)

%t LinearRecurrence[{1,-1,1},{1,7,24},90] (* or *) PadRight[{},90,{1,7,24,18}] (* _Harvey P. Dale_, Jan 07 2024 *)

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

%o (PARI) a(n) = lift(Mod(7, 25)^n); \\ _Altug Alkan_, Mar 20 2016

%o (Magma) [Modexp(7, n, 25): n in [0..100]]; // _Bruno Berselli_, Mar 22 2016

%K nonn

%O 0,2

%A _N. J. A. Sloane_, May 12 2002