login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A010874 a(n) = n mod 5. 47
0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Complement of A002266, since 5*A002266(n) + a(n) = n. - Hieronymus Fischer, Jun 01 2007

LINKS

Muniru A Asiru, Table of n, a(n) for n = 0..1000

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

FORMULA

Complex representation: a(n) = (1/5)*(1-r^n)*Sum{1<=k<5, k*Product{1<=m<5,m<>k, (1-r^(n-m))}} where r=exp(2*Pi/5*i) and i=sqrt(-1).

G.f.: g(x)=(4*x^4+3*x^3+2*x^2+x)/(1-x^5). - Hieronymus Fischer, May 29 2007

Trigonometric representation: a(n) = (16/5)^2*(sin(n*Pi/5))^2*Sum{1<=k<5, k*Product{1<=m<5,m<>k, (sin((n-m)*Pi/5))^2}}. Clearly, the squared terms may be replaced by their absolute values '|.|'. This formula can be easily adapted to represent any periodic sequence.

G.f.: also g(x) = x*(5*x^6 - 6*x^5 + 1)/((1-x^5)*(1-x)^2). - Hieronymus Fischer, Jun 01 2007

a(n) = -cos(4/5*Pi*n)-cos(2/5*Pi*n)+1/20*5^(1/2)*(10-2*5^(1/2))^(1/2)* sin(4/5*Pi*n)-1/4*(10-2*5^(1/2))^(1/2)*sin(4/5*Pi*n)-1/4*(10+2*5^(1/2))^(1/2)*sin(2/5*Pi*n)-1/20*5^(1/2)*(10+2*5^(1/2))^(1/2)*sin(2/5*Pi*n) + 2. - Leonid Bedratyuk, May 14 2012

a(n) = floor(1234/99999*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013

a(n) = floor(97/1562*5^(n+1)) mod 5. - Hieronymus Fischer, Jan 04 2013

From Wesley Ivan Hurt, Jul 23 2016: (Start)

a(n) = a(n-5) for n>4.

a(n) = 4*(1 - floor(n/5)) + Sum_{k=1..4} floor((n-k)/5).

a(n) = 4 - 4*floor(n/5) + floor((n-1)/5) + floor((n-2)/5) + floor((n-3)/5) + floor((n-4)/5).

a(n) = n - 5*floor(n/5). (End)

a(n) = 2 + (2/5)*Sum_{k=1..4} k*((cos(2*(n-k)*Pi/5) + cos(4*(n-k)*Pi/5)). - Wesley Ivan Hurt, Sep 27 2018

MAPLE

seq(chrem( [n, n], [1, 5] ), n=0..80); # Zerinvary Lajos, Mar 25 2009

MATHEMATICA

Mod[Range[0, 100], 5] (* Wesley Ivan Hurt, Jul 23 2016 *)

PROG

(PARI) a(n)=n%5 \\ Charles R Greathouse IV, Sep 24 2015

(MAGMA) [n mod 5 : n in [0..100]]; // Wesley Ivan Hurt, Jul 23 2016

(GAP) List([0..100], n->n mod 5); # Muniru A Asiru, Sep 28 2018

CROSSREFS

Partial sums: A130483.

Cf. A130481, A130482, A130484, A130485, A004526, A002264, A002265, A002266.

Sequence in context: A031235 A090141 A049264 * A278182 A125926 A125923

Adjacent sequences:  A010871 A010872 A010873 * A010875 A010876 A010877

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 21:09 EDT 2018. Contains 316505 sequences. (Running on oeis4.)