A011655 Period 3: repeat [0, 1, 1].
0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1
Offset: 0
Examples
G.f. = x + x^2 + x^4 + x^5 + x^7 + x^8 + x^10 + x^11 + x^13 + x^14 + x^16 + x^17 + ...
References
- S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967.
- H. D. Lueke, Korrelationssignale, Springer 1992, pp. 43-48.
- F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, Elsevier/North Holland, 1978, p. 408.
- K. Mahler, p-adic numbers and their functions, 2nd ed., Cambridge University press, 1981.
- Paulo Ribenboim, The Little Book of Big Primes. Springer-Verlag, NY, 1991, p. 46. [Rick L. Shepherd, Feb 07 2009]
Links
- Andrei Asinowski, Cyril Banderier and Valerie Roitner, Generating functions for lattice paths with several forbidden patterns, (2019).
- Marcia Edson, Scott Lewis and Omer Yayenie, The k-periodic Fibonacci sequence and an extended Binet's formula, INTEGERS 11 (2011) #A32.
- Alex Fink, Richard K. Guy, and Mark Krusemeyer, Partitions with parts occurring at most thrice, Contributions to Discrete Mathematics, Vol 3, No 2 (2008), pp. 76-114. See Section 13.
- L. B. W. Jolley, Summation of Series, Dover, (1961).
- Index entries for two-way infinite sequences
- Index entries for linear recurrences with constant coefficients, signature (0,0,1).
- Index entries for characteristic functions.
- Index entries for sequences related to Chebyshev polynomials..
Crossrefs
Programs
-
Haskell
a011655 = fromEnum . ((/= 0) . (`mod` 3)) a011655_list = cycle [0,1,1] -- Reinhard Zumkeller, Apr 07 2012
-
Magma
[(n^2 mod 3) : n in [0..100]]; // Wesley Ivan Hurt, Apr 16 2015
-
Maple
A011655:=n->(n^2 mod 3): seq(A011655(n), n=0..100); # Wesley Ivan Hurt, Apr 16 2015
-
Mathematica
A011655[n_] := If[Mod[n, 3] == 0, 0, 1]; Array[A011655, 105, 0] (* Robert G. Wilson v *) Mod[Fibonacci[Range[0, 99]], 2] (* Alonso del Arte, Jul 20 2017 *)
-
PARI
{a(n) = sign(n%3)};
-
PARI
a(n)=!!(n%3) \\ Jaume Oliver Lafont, Mar 24 2009
-
PARI
a(n)=n%3>0 \\ M. F. Hasler, Feb 17 2018
-
Python
def A011655(n): return int(bool(n%3)) # Chai Wah Wu, May 25 2022
Formula
G.f.: (x + x^2) / (1 - x^3) = Sum_{k>0} (x^k - x^(3*k)).
G.f.: x / (1 - x / (1 + x / (1 + x / (1 - 2*x / (1 + x))))). - Michael Somos, Apr 02 2012
a(n) = a(n+3) = a(-n), a(3*n) = 0, a(3*n + 1) = a(3*n + 2) = 1 for all n in Z.
a(n) = (1/2)*( (-1)^(floor((2n + 4)/3)) + 1 ). - Mario Catalani (mario.catalani(AT)unito.it), Oct 22 2003
a(n) = Fibonacci(n) mod 2. - Paul Barry, Nov 12 2003
a(n) = (2/3)*(1 - cos(2*Pi*n/3)). - Ralf Stephan, Jan 06 2004
a(n) = 1 - a(n-1)*a(n-2), a(n) = n for n < 2. - Reinhard Zumkeller, Feb 28 2004
a(n) = 2*(1 - T(n, -1/2))/3 with Chebyshev's polynomials T(n, x) of the first kind; see A053120. - Wolfdieter Lang, Oct 18 2004
a(n) = n*Sum_{k=0..floor(n/2)} (-1)^k*binomial(n-k, k)*A001045(n-2k)/(n-k). - Paul Barry, Oct 31 2004
a(n) = A002487(n) mod 2. - Paul Barry, Jan 14 2005
From Bruce Corrigan (scentman(AT)myfamily.com), Aug 08 2005: (Start)
a(n) = n^2 mod 3.
a(n) = (1/3)*(2 - (r^n + r^(2*n))) where r = (-1 + sqrt(-3))/2. (End)
From Michael Somos, Sep 23 2005: (Start)
Euler transform of length 3 sequence [ 1, -1, 1].
Moebius transform is length 3 sequence [ 1, 0, -1].
Multiplicative with a(3^e) = 0^e, a(p^e) = 1 otherwise. (End)
From Hieronymus Fischer, Jun 27 2007: (Start)
a(n) = (4/3)*(|sin(Pi*(n-2)/3)| + |sin(Pi*(n-1)/3)|)*|sin(Pi*n/3)|.
a(n) = ((n+1) mod 3 + 1) mod 2 = (1 - (-1)^(n - 3*floor((n+1)/3)))/2. (End)
a(n) = 2 - a(n-1) - a(n-2) for n > 1. - Reinhard Zumkeller, Apr 13 2008
a(2*n+1) = a(n+1) XOR a(n), a(2*n) = a(n), a(1) = 1, a(0) = 0. - Reinhard Zumkeller, Dec 27 2008
Sum_{n>=1} a(n)/n^s = (1-1/3^s)*Riemann_zeta(s), s > 1. - R. J. Mathar, Jul 31 2010
a(n) = floor((4*n-5)/3) mod 2. - Gary Detlefs, May 15 2011
a(n) = (a(n-1) - a(n-2))^2 with a(0) = 0, a(1) = 1. - Francesco Daddi, Aug 02 2011
G.f.: Sum_{k>0} x^A001651(k). - L. Edson Jeffery, Dec 05 2012
G.f.: x/(G(0) - x^2) where G(k) = 1 - x/(x + 1/(1 - x/G(k+1))); (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 15 2013
For the general case: The characteristic function of numbers that are not multiples of m is a(n) = floor((n-1)/m) - floor(n/m) + 1, with m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = sign(n mod 3). - Wesley Ivan Hurt, Jun 22 2013
a(n) = (-n mod 3)^((n-1) mod 3). - Wesley Ivan Hurt, Apr 16 2015
a(n) = (2/3) * (1 - sin((Pi/6) * (4*n + 3))) for n >= 0. - Werner Schulte, Jul 20 2017
a(n) = a(n-1) XOR a(n-2) with a(0) = 0, a(1) = 1. - Chunqing Liu, Dec 18 2022
E.g.f.: 2*(exp(x) - exp(-x/2)*cos(sqrt(3)*x/2))/3. - Stefano Spezia, Mar 30 2025
Dirichlet g.f.: zeta(s)*(1-1/3^s). - R. J. Mathar, Aug 10 2025
Extensions
Better name from Omar E. Pol, Oct 28 2013
Comments