A133872 Period 4: repeat [1, 1, 0, 0].
1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1
Offset: 0
Examples
G.f. = 1 + x + x^4 + x^5 + x^8 + x^9 + x^12 + x^13 + x^16 + x^17 + x^20 + ...
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..10000
- Clark Kimberling, A Combinatorial Classification of Triangle Centers on the Line at Infinity, J. Int. Seq., Vol. 22 (2019), Article 19.5.4.
- Psychedelic Geometry Blogspot, Curious Series-001 [_Enrique Pérez Herrero_, Aug 16 2009]
- Index entries for characteristic functions
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1).
Crossrefs
Programs
-
Magma
[ (1 + (-1)^Floor(n/2))/2 : n in [0..50] ]; // Wesley Ivan Hurt, Jun 09 2014
-
Magma
&cat[[1,1,0,0]^^25]; // Vincenzo Librandi, Jan 09 2016
-
Maple
A133872:=n->(1+(-1)^((2n-1+(-1)^n)/4))/2; seq(A133872(n), n=0..100); # Wesley Ivan Hurt, Dec 06 2013
-
Mathematica
Table[(1 + (-1)^((2 n - 1 + (-1)^n)/4))/2, {n, 0, 100}] (* Wesley Ivan Hurt, Dec 06 2013 *) PadRight[{},120,{1,1,0,0}] (* Harvey P. Dale, Jan 26 2014 *)
-
PARI
a(n)=n%4<2 \\ Jaume Oliver Lafont, Mar 17 2009
-
PARI
Vec((1+x)/(1-x^4) + O(x^100)) \\ Altug Alkan, Jan 08 2015
-
Python
def A133872(n): return int(not n&2) # Chai Wah Wu, Jan 31 2023
-
R
maxn <- 63 # by choice a <- c(1,0,0) for(n in 4:maxn) a[n] <- a[n-1] - a[n-2] + a[n-3] (a <- a(1,a)) # Yosu Yurramendi, Oct 25 2020
Formula
a(n) = (1 + floor(n/2)) mod 2.
a(n) = 1 + floor(n/2) - 2*floor((n+2)/4).
a(n) = (((n+2) mod 4) - (n mod 2))/2.
a(n) = ((n + 2 - (n mod 2))/2) mod 2.
a(n) = ((2*n + 3 + (-1)^n)/4) mod 2.
a(n) = (1 + (-1)^((2*n - 1 + (-1)^n)/4))/2.
a(n) = binomial(n+2, n) mod 2 = binomial(n+2, 2) mod 2.
a(n) = A000217(n+1) mod 2.
G.f.: (1+x)/(1-x^4) = 1/((1-x)(1+x^2)).
a(n) = 1/2 + (1/2)*cos(Pi*n/2) + (1/2)*sin(Pi*n/2). a(n) = A021913(n+2). - R. J. Mathar, Nov 15 2007
From Jaume Oliver Lafont, Dec 05 2008: (Start)
a(n) = 1/2 + sin((2n+1)Pi/4)/sqrt(2).
a(n) = 1/2 + cos((2n-1)Pi/4)/sqrt(2). (End)
a(n) = Re(Sum_{k=0..n} i^k), where i=sqrt(-1) and Re is the real part of a complex number. a(n) = (1/2)*((Sum_{k=0..n} i^k) + Sum_{k=0..n} i^-k) = Re((1/2)*(1 + i)*(1 - i^(n+1))). - Enrique Pérez Herrero, Aug 16 2009
a(n) = (1 + i^(n*(n-1)))/2, where i=sqrt(-1). - Bruno Berselli, May 18 2011
a(n) = (Sum_{k=1..n} k^j) mod 2, for any j. - Gary Detlefs, Dec 28 2011
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2. - Jean-Christophe Hervé, May 01 2013
a(n) = (1 + (-1)^floor(n/2))/2. - Wesley Ivan Hurt, Apr 17 2014
Euler transform of length 4 sequence [1, -1, 0, 1]. - Michael Somos, Sep 26 2014
a(n) = a(1-n) for all n in Z. - Michael Somos, Sep 26 2014
From Ilya Gutkovskiy, Jul 09 2016: (Start)
Inverse binomial transform of A038504(n+1).
E.g.f.: (exp(x) + sin(x) + cos(x))/2. (End)
a(n) = (1 + (-1)^(n*(n-1)/2))/2. - Guenther Schrack, Apr 04 2019
Extensions
Definition rewritten by N. J. A. Sloane, Apr 30 2009
Comments