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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A133872 Period 4: repeat [1, 1, 0, 0]. 50
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Partial sums of A056594.

Let i=sqrt(-1) and S(n)=Sum_{k=0..n-1} exp(2*Pi*i*k^2/n) for n>=1 the famous Gauss sum. Then S(n)=(a(n)+a(n+1)*i)*sqrt(n). - Franz Vrabec, Nov 08 2007

For any n>=1 the sequence gives the minimum value m>=0 we can get using addition and subtraction among all the numbers from 1 to n. E.g.: n=1 -> m=1; n=2 -> m=2-1=1; n=3 -> m=3-2-1=0; n=4 -> m=4-3-2+1=0; n=5 -> m=5-4+3-2-1=1; n=6 -> m=6+5-4-3-2-1=6-5+4-3-2+1=1; n=7 -> m=7-6+5-4-3+2-1=7+6-5-4-3-2+1=0; etc. - Paolo P. Lava, Feb 29 2008

a(A042948(n)) = 1; a(A042964(n)) = 0. - Reinhard Zumkeller, Oct 03 2008

a(n) is also the real part of partial sum of powers of the complex unit i. - Enrique Pérez Herrero, Aug 16 2009

Periodic sequences having a period of 2k and composed of k ones followed by k zeros have a closed formula of floor(((n+k) mod 2k)/k). Listed sequences of this form are: k=1..A000035(n+1), k=2..A133872(n), k=3..A088911, k=4..A131078(n), k=5..A112713(n-1). - Gary Detlefs, May 17 2011

0.repeat(0,0,1,1) is 1/5 in base 2, due to 1/5 = (3/16)/(1-1/16). For the general case see 1/A062158(n) in base n >= 2. Here n = 2. - Wolfdieter Lang, Jun 20 2014

a(n) (for n>=1) is the determinant of the n X n Toeplitz matrix M satisfying: M(i,j)=1 if -1<=j-i<=2 and 0 otherwise. - Dmitry Efimov, Jun 23 2015

a(n) (for n>=1) is the difference between numbers of even and odd permutations p of 1,2,..,n such that -1<=p(i)-i<=2 for i=1,2,..,n. - Dmitry Efimov, Jan 08 2016

LINKS

Table of n, a(n) for n=0..104.

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).

FORMULA

a(n) = (1 + floor(n/2)) mod 2.

a(n) = A004526(A000035(n+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

a(n) = (1/12)*(-2*(n mod 4) + ((n+1) mod 4)+4*((n+2) mod 4)+((n+3) mod 4)), with n>=0. - Paolo P. Lava, Oct 06 2008

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^j, k=1..n) 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 - floor(n/2) + 2*floor(n/4) = 1 - A004526(n) + A122461(n). - Wesley Ivan Hurt, Dec 06 2013

a(n) = (1 + (-1)^floor(n/2))/2. - Wesley Ivan Hurt, Apr 17 2014

a(n) = A054925(n+2) - A011848(n+2). - Wesley Ivan Hurt, Jun 09 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

EXAMPLE

G.f. = 1 + x + x^4 + x^5 + x^8 + x^9 + x^12 + x^13 + x^16 + x^17 + x^20 + ...

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 *)

PROG

(PARI) a(n)=n%4<2 \\ Jaume Oliver Lafont, Mar 17 2009

(MAGMA) [ (1 + (-1)^Floor(n/2))/2 : n in [0..50] ]; // Wesley Ivan Hurt, Jun 09 2014

(PARI) Vec((1+x)/(1-x^4) + O(x^100)) \\ Altug Alkan, Jan 08 2015

(MAGMA) &cat[[1, 1, 0, 0]^^25]; // Vincenzo Librandi, Jan 09 2016

CROSSREFS

Cf. A056594, A133620-A133625, A133630, A038509, A133634-A133636, A021913, A000217, A133882, A133880, A133890, A133900, A133910, A000035, A088911, A131078, A112713.

Sequence in context: A320006 A219977 A128130 * A286903 A284490 A284505

Adjacent sequences:  A133869 A133870 A133871 * A133873 A133874 A133875

KEYWORD

nonn,easy

AUTHOR

Hieronymus Fischer, Oct 10 2007

EXTENSIONS

Definition rewritten by N. J. A. Sloane, Apr 30 2009

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 09:56 EDT 2019. Contains 328315 sequences. (Running on oeis4.)