%I #20 Apr 25 2024 09:15:19
%S 0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,
%T 1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,
%U 2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2,4,4,2,1,0,1,2
%N a(n) = n^4 mod 7.
%C Equivalently: n^(4*m + 4) mod 7. - _G. C. Greubel_, Apr 01 2016
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 1).
%F From _G. C. Greubel_, Apr 01 2016: (Start)
%F a(n) = a(n-7).
%F G.f.: x*(1 +2*x +4*x^2 +2*x^4 + x^5)/(1 - x^7). (End)
%t PowerMod[Range[0, 100], 4, 7] (* _G. C. Greubel_, Apr 01 2016 *)
%o (Sage) [power_mod(n,4,7)for n in range(0, 101)] # _Zerinvary Lajos_, Oct 30 2009
%o (Magma) [Modexp(n, 4, 7): n in [0..100]]; // _Vincenzo Librandi_, Apr 02 2016
%o (PARI) a(n)=n^4%7 \\ _Charles R Greathouse IV_, Apr 06 2016
%K nonn,easy,changed
%O 0,3
%A _N. J. A. Sloane_, May 13 2002
|