cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070366 a(n) = 5^n mod 9.

This page as a plain text file.
%I A070366 #70 Mar 20 2025 12:10:14
%S A070366 1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,
%T A070366 4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,
%U A070366 7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7,8,4,2,1,5,7
%N A070366 a(n) = 5^n mod 9.
%C A070366 Period 6: repeat [1, 5, 7, 8, 4, 2].
%C A070366 Also the digital root of 5^n. - _Cino Hilliard_, Dec 31 2004
%C A070366 Digital root of the powers of any number congruent to 5 mod 9. - _Alonso del Arte_, Jan 26 2014
%D A070366 Cecil Balmond, Number 9: The Search for the Sigma Code. Munich, New York: Prestel (1998): 203.
%H A070366 G. C. Greubel, <a href="/A070366/b070366.txt">Table of n, a(n) for n = 0..1000</a>
%H A070366 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,-1,1).
%F A070366 From _R. J. Mathar_, Apr 20 2010: (Start)
%F A070366 a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.
%F A070366 G.f.: ( 1+4*x+2*x^2+2*x^3 ) / ( (1-x)*(1+x)*(x^2-x+1) ). (End)
%F A070366 a(n) = 1/2^n (mod 9), n >= 0. - _Wolfdieter Lang_, Feb 18 2014
%F A070366 a(n) = A010878(A000351(n)). - _Michel Marcus_, Feb 20 2014
%F A070366 From _G. C. Greubel_, Mar 05 2016: (Start)
%F A070366 a(n) = a(n-6) for n>5.
%F A070366 E.g.f.: (1/2)*(9*exp(x) - exp(-x) + 2*sqrt(3)*exp(x/2)*sin(sqrt(3)*x/2) - 6*exp(x/2)*cos(sqrt(3)*x/2)). (End)
%F A070366 a(n) = (9 - cos(n*Pi) - 6*cos(n*Pi/3) + 2*sqrt(3)*sin(n*Pi/3))/2. - _Wesley Ivan Hurt_, Jun 28 2016
%F A070366 a(n) = 2^((-n) mod 6) mod 9. - _Joe Slater_, Mar 23 2017
%F A070366 a(n) = A007953(5*a(n-1)) = A010888(5*a(n-1)). - _Stefano Spezia_, Mar 20 2025
%p A070366 A070366:=n->power(5,n) mod 9: seq(A070366(n), n=0..100); # _Wesley Ivan Hurt_, Jun 28 2016
%t A070366 PowerMod[5, Range[0, 120], 9] (* _Harvey P. Dale_, Mar 27 2011 *)
%t A070366 Table[Mod[5^n, 9], {n, 0, 100}] (* _G. C. Greubel_, Mar 05 2016 *)
%o A070366 (PARI) a(n)=lift(Mod(5,9)^n); \\ _Charles R Greathouse IV_, Sep 24 2015
%o A070366 (Magma) [Modexp(5, n, 9): n in [0..100]]; // _Wesley Ivan Hurt_, Jun 28 2016
%Y A070366 Cf. Digital roots of powers of c mod 9: c = 2, A153130; c = 4, A100402; c = 7, A070403; c = 8, A010689.
%Y A070366 Cf. A000351, A007953, A010878, A010888.
%K A070366 nonn,easy
%O A070366 0,2
%A A070366 _N. J. A. Sloane_, May 12 2002