login
This site is supported by donations 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

Table of n, a(n) for n=0..80.

H. K. Funda, How to find out last digit

Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,1).

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

Adjacent sequences:  A173632 A173633 A173634 * A173636 A173637 A173638

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 18 15:44 EDT 2019. Contains 325144 sequences. (Running on oeis4.)