This site is supported by donations to The OEIS Foundation.

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A000035 Period 2: repeat [0, 1]; a(n) = n mod 2; parity of n. (Formerly M0001) 473

%I M0001

%S 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,

%T 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,

%U 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0

%N Period 2: repeat [0, 1]; a(n) = n mod 2; parity of n.

%C Least significant bit of n, lsb(n).

%C Also decimal expansion of 1/99.

%C Also the binary expansion of 1/3. - _Robert G. Wilson v_, Sep 01 2015

%C a(n) = ABS(A134451(n)). - _Reinhard Zumkeller_, Oct 27 2007

%C Characteristic function of odd numbers: a(A005408(n)) = 1, a(A005843(n)) = 0. - _Reinhard Zumkeller_, Sep 29 2008

%C A102370(n) modulo 2. - _Philippe Deléham_, Apr 04 2009

%C Base b expansion of 1/(b^2-1) for any b >= 2 is 0.0101... (A005563 has b^2-1). - _Rick L. Shepherd_, Sep 27 2009

%C Let A be the Hessenberg n X n matrix defined by: A[1,j] = j mod 2, A[i,i] := 1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n) = (-1)^n*charpoly(A,1). - _Milan Janjic_, Jan 24 2010

%C From _R. J. Mathar_, Jul 15 2010: (Start)

%C The sequence is the principal Dirichlet character of the reduced residue system mod 2 or mod 4 or mod 8 or mod 16...

%C Associated Dirichlet L-functions are for example L(2,chi) = sum_{n>=1} a(n)/n^2 == A111003,

%C or L(3,chi) = sum_{n>=1} a(n)/n^3 = 1.05179979... = 7*A002117/8,

%C or L(4,chi) = sum_{n>=1} a(n)/n^4 = 1.014678... = A092425/96. (End)

%C Also parity of the nonnegative integers A001477. - _Omar E. Pol_, Jan 17 2012

%C a(n) = (4/n), where (k/n) is the Kronecker symbol. See the Eric Weisstein link. - _Wolfdieter Lang_, May 28 2013

%C Also the inverse binomial transform of A131577. - _Paul Curtz_, Nov 16 2016 [an observation forwarded by _Jean-François Alcover_].

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H David Wasserman, <a href="/A000035/b000035.txt">Table of n, a(n) for n = 0..1000</a>

%H Paul Barry, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL8/Barry/barry84.html">A Catalan Transform and Related Transformations on Integer Sequences</a>, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.

%H Y. Puri and T. Ward, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL4/WARD/short.html">Arithmetic and growth of periodic orbits</a>, J. Integer Seqs., Vol. 4 (2001), #01.2.1.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DirichletSeriesGeneratingFunction.html">Dirichlet Series Generating Function</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/KroneckerSymbol.html">Kronecker Symbol</a>

%H A. K. Whitford, <a href="http://www.fq.math.ca/Scanned/15-1/whitford-a.pdf">Binet's Formula Generalized</a>, Fibonacci Quarterly, Vol. 15, No. 1, 1979, pp. 21, 24, 29

%H <a href="/index/Cor#core">Index entries for "core" sequences</a>

%H <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1).

%F a(n) = (1 - (-1)^n)/2.

%F a(n) = n mod 2.

%F a(n) = 1 - a(n-1).

%F Multiplicative with a(p^e) = p%2. - _David W. Wilson_, Aug 01 2001

%F G.f.: x/(1-x^2). E.g.f.: sinh(x). - _Paul Barry_, Mar 11 2003

%F a(n) = (A000051(n) - A014551(n))/2. - Mario Catalani (mario.catalani(AT)unito.it), Aug 30 2003

%F a(n) = ceil((-2)^(-n-1)). - _Reinhard Zumkeller_, Apr 19 2005

%F a(n) = (sin(n*Pi/2))^2 = (cos(n*Pi/2 +/- Pi/2))^2 with n >= 0. - _Paolo P. Lava_, Sep 20 2006

%F Dirichlet g.f.: (1-1/2^s)*zeta(s). - _R. J. Mathar_, Mar 04 2011

%F a(n) = ceil(n/2) - floor(n/2). - _Arkadiusz Wesolowski_, Sep 16 2012

%F a(n) = ceil( cos(Pi*(n-1))/2 ). - _Wesley Ivan Hurt_, Jun 16 2013

%F a(n) = floor((n-1)/2)-floor((n-2)/2). - _Mikael Aaltonen_, Feb 26 2015

%F Dirichlet g.f.: L(chi(2),s) with chi(2) the principal Dirichlet character modulo 2. - _Ralf Stephan_, Mar 27 2015

%F a(n) = 0^^n = 0^(0^(0...)) (n times), where we take 0^0 to be 1. - _Natan Arie' Consigli_, May 02 2015

%p A000035 := n->n mod 2;

%p [ seq(i mod 2, i=0..100) ];

%t Nest[Flatten[ # /. {0 -> {0, 1}, 1 -> {0, 1}}] &, {0}, 7] (* _Robert G. Wilson v_, Mar 05 2005 *)

%t Nest[ Flatten[ # /. {0 -> {0, 1, 0}}] &, {0}, 5] (* _Robert G. Wilson v_, Sep 01 2005 *)

%t CellularAutomaton[50, {{0, 1}, 0}, 104, {All, {0}}] // Flatten (* _Zerinvary Lajos_, Jul 08 2009 *)

%t PadLeft[{},110,{0,1}] (* _Harvey P. Dale_, Sep 25 2011 *)

%t a[n_] := Floor[(n-1)/2] - Floor[(n-2)/2]; Array[a, 105, 0] (* _Robert G. Wilson v_, Feb 26 2015 *)

%o (PARI) a(n)=n%2;

%o (PARI) a(n)=direuler(p=1,100,if(p==2,1,1/(1-X)))[n] /* _Ralf Stephan_, Mar 27 2015 */

%o a000035 n = n `mod` 2 -- _James Spahlinger_, Oct 08 2012

%o a000035_list = cycle [0,1] -- _Reinhard Zumkeller_, Jan 06 2012

%o (Maxima) A000035(n):=mod(n,2)\$

%o makelist(A000035(n),n,0,30); /* _Martin Ettl_, Nov 12 2012 */

%o (MAGMA) [0^(1 - n mod 2): n in [0..100]]; // _Vincenzo Librandi_, Nov 09 2014

%o (Scheme) (define (A000035 n) (mod n 2)) ;; For R6RS. Use modulo in older Schemes like MIT/GNU Scheme. - _Antti Karttunen_, Mar 21 2017

%Y Ones complement of A059841.

%Y Cf. A053644 for most significant bit.

%Y This is Guy Steele's sequence GS(1, 2) (see A135416).

%Y Period k zigzag sequences: this sequence (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).

%Y Cf. A154955 (Mobius transform)

%K cons,core,easy,nonn,nice,mult

%O 0,1

%A _N. J. A. Sloane_

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.

Last modified January 18 23:05 EST 2019. Contains 319282 sequences. (Running on oeis4.)