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.

A010874 a(n) = n mod 5.

Original entry on oeis.org

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
Offset: 0

Views

Author

Keywords

Comments

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

Crossrefs

Programs

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