login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A173635 Period 5 sequence: 1, 1, 4, 4, 2, ... 8
1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(n) is the length of the period of the sequence (n^i) mod m, i=1,2,...; m = 10 or m = 5.
LINKS
FORMULA
a(n) = (1 + floor((n mod 5)/2))^2 mod 7. - Victor Dumbrava, Jan 12 2018
G.f.: (1 + x + 4*x^2 + 4*x^3 + 2*x^4)/(1 - x^5). - Iain Fox, Jan 12 2018
EXAMPLE
a(0) = 1 because (0^i) mod 10 = 0, i=1,2,...;
a(2) = 4 since(2^1) mod 5 = 2, (2^2) mod 5 = 4, (2^3) mod 5 = 3, (2^4) mod 5 = 1, and (2^5) mod 5 = 2 again. So we have the sequence 2,4,3,1,... with period of length 4.
MATHEMATICA
Flatten[Table[{1, 1, 4, 4, 2}, {20}]] (* T. D. Noe, Nov 20 2012 *)
CoefficientList[ Series[(-1 - x - 4x^2 - 4x^3 - 2x^4)/(x^5 -1), {x, 0, 104}], x] (* or *)
LinearRecurrence[{0, 0, 0, 0, 1}, {1, 1, 4, 4, 2}, 105] (* Robert G. Wilson v, Jan 20 2018 *)
PROG
(PARI) a(n) = [1, 1, 4, 4, 2][(n%5)+1] \\ Iain Fox, Jan 12 2018
(PARI) a(n) = ((1 + floor((n%5)/2))^2) % 7 \\ Iain Fox, Jan 12 2018
(PARI) first(n) = Vec((1 + x + 4*x^2 + 4*x^3 + 2*x^4)/(1 - x^5) + O(x^n)) \\ Iain Fox, Jan 12 2018
(Magma) &cat[ [1, 1, 4, 4, 2]: n in [0..23] ]; // Vincenzo Librandi, Jan 19 2018
CROSSREFS
Sequence in context: A058888 A194678 A153015 * A196766 A153163 A168455
KEYWORD
nonn,easy
AUTHOR
Washington Bomfim, Nov 23 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 21 22:18 EDT 2024. Contains 374477 sequences. (Running on oeis4.)