|
| |
| |
|
|
|
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 0,3
|
|
|
COMMENTS
| Complement of A002264, since 3*A002264(n)+a(n)=n. - Hieronymus Fischer (Hieronymus.Fischer(AT)gmx.de), Jun 01 2007
|
|
|
LINKS
| Index entries for sequences related to linear recurrences with constant coefficients
Ralph E. Griswold, Shaft Sequences
|
|
|
FORMULA
| a(n) = n-3*floor(n/3) = a(n-3)
G.f.: (2x^2+x)/(1-x^3). a(n)=(1/2)(-1)^floor(2n/3)-(-1)^floor((2n-1)/3)-(3/2)(-1)^floor((2n+1)/3). a(n)=3*A022003(n)+A049347(n+2). - Mario Catalani (mario.catalani(AT)unito.it), Jan 08 2003
Fixed point of morphism 0 -> 01, 1 -> 20, 2 -> 12.
a(n)=1+(1-2cos(2*pi*(n-1)/3))*sin(2*pi*(n-1)/3))/sqrt(3).
Complex representation: a(n)=1/3*(1-r^n)*(1+r^n/(1-r)) where r=exp(2*pi/3*i)=(-1+sqrt(3)*i)/2 and i=sqrt(-1). - Hieronymus Fischer (Hieronymus.Fischer(AT)gmx.de), May 29 2007
Other trigonometric representation: a(n)=(16/9)*((sin(pi*(n-2)/3))^2+2*(sin(pi*(n-1)/3))^2)*(sin(pi*n/3))^2.
Also: a(n)=(4/3)*(|sin(pi*(n-2)/3)|+2*|sin(pi*(n-1)/3)|)*|sin(pi*n/3)|.
Also: a(n) = (4/9)*((1-cos(2*pi*(n-2)/3))+2*(1-cos(2*pi*(n-1)/3)))*(1-cos(2*pi*n/3)). These formulas can be easily adapted to represent any peridoc sequence. - Hieronymus Fischer (Hieronymus.Fischer(AT)gmx.de), Jun 01 2007
Formulas above edited for better readability by Hieronymus Fischer
a(n) = 3 - a(n-1) - a(n-2) for n > 1. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Apr 13 2008
a(n)=1-2*sin(4*pi*(n+2)/3)/sqrt(3) [From Jaume Oliver Lafont (joliverlafont(AT)gmail.com), Dec 05 2008]
This one is derived using the closed form for the fibonacci numbers: a(n)=3/2-(-1)^((1/5*((1/2+(1/2)*sqrt(5))^(x+1)-(1/2-(1/2)*sqrt(5))^(x+1)))*sqrt(5)+1)-(1/2)*(-1)^((1/5*((1/2+(1/2)*sqrt(5))^(x+2)-(1/2-(1/2)*sqrt(5))^(x+2)))*sqrt(5)+1) [From Ben Thurston (benpaulthurston(AT)gmail.com), Mar 27 2010]
|
|
|
MAPLE
| seq(chrem( [n, n], [1, 3] ), n=0..100); # [From Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Mar 25 2009]
|
|
|
MATHEMATICA
| Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 1}, 1 -> {2, 0}, 2 -> {1, 2}})]}], {0}, 7] (from Robert G. Wilson v Feb 28 2005)
|
|
|
PROG
| (Other) sage: [power_mod(n, 3, 3 )for n in xrange(0, 105)] # [From Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Oct 29 2009]
|
|
|
CROSSREFS
| Cf. A000035, A010873. A080425, A004526, A002264, A002265, A002266.
Cf. partial sums: A130481. Other related sequences A130482, A130483, A130484, A130485.
Sequence in context: A166124 A134979 A112248 * A025858 A025684 A025678
Adjacent sequences: A010869 A010870 A010871 * A010873 A010874 A010875
|
|
|
KEYWORD
| easy,nonn
|
|
|
AUTHOR
| N. J. A. Sloane (njas(AT)research.att.com).
|
| |
|
|