A000035 Period 2: repeat [0, 1]; a(n) = n mod 2; parity of n.
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, 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, 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
Offset: 0
Examples
G.f. = x + x^3 + x^5 + x^7 + x^9 + x^11 + x^13 + x^15 + ... - _Michael Somos_, Feb 20 2024
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- David Wasserman, Table of n, a(n) for n = 0..1000
- Paul Barry, A Catalan Transform and Related Transformations on Integer Sequences, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.
- F. Javier de Vega, An extension of Furstenberg's theorem of the infinitude of primes, arXiv:2003.13378 [math.NT], 2020.
- Clark Kimberling, A Combinatorial Classification of Triangle Centers on the Line at Infinity, J. Int. Seq., Vol. 22 (2019), Article 19.5.4.
- Y. Puri and T. Ward, Arithmetic and growth of periodic orbits, J. Integer Seqs., Vol. 4 (2001), #01.2.1.
- Eric Weisstein's World of Mathematics, Dirichlet Series Generating Function
- Eric Weisstein's World of Mathematics, Kronecker Symbol
- A. K. Whitford, Binet's Formula Generalized, Fibonacci Quarterly, Vol. 15, No. 1, 1979, pp. 21, 24, 29
- Index entries for "core" sequences
- Index entries for sequences that are fixed points of mappings
- Index entries for characteristic functions
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Crossrefs
Ones complement of A059841.
Cf. A053644 for most significant bit.
This is Guy Steele's sequence GS(1, 2) (see A135416).
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).
Parity of A005811.
Programs
-
Haskell
a000035 n = n `mod` 2 -- James Spahlinger, Oct 08 2012
-
Haskell
a000035_list = cycle [0,1] -- Reinhard Zumkeller, Jan 06 2012
-
Maple
A000035 := n->n mod 2; [ seq(i mod 2, i=0..100) ];
-
Mathematica
PadLeft[{},110,{0,1}] (* Harvey P. Dale, Sep 25 2011 *)
-
Maxima
A000035(n):=mod(n,2)$ makelist(A000035(n),n,0,30); /* Martin Ettl, Nov 12 2012 */
-
PARI
a(n)=n%2;
-
PARI
a(n)=direuler(p=1,100,if(p==2,1,1/(1-X)))[n] /* Ralf Stephan, Mar 27 2015 */
-
Python
def A000035(n): return n & 1 # Chai Wah Wu, May 25 2022
-
Scheme
(define (A000035 n) (mod n 2)) ;; For R6RS. Use modulo in older Schemes like MIT/GNU Scheme. - Antti Karttunen, Mar 21 2017
Formula
a(n) = (1 - (-1)^n)/2.
a(n) = n mod 2.
a(n) = 1 - a(n-1).
Multiplicative with a(p^e) = p mod 2. - David W. Wilson, Aug 01 2001
G.f.: x/(1-x^2). E.g.f.: sinh(x). - Paul Barry, Mar 11 2003
a(n) = ceiling((-2)^(-n-1)). - Reinhard Zumkeller, Apr 19 2005
Dirichlet g.f.: (1-1/2^s)*zeta(s). - R. J. Mathar, Mar 04 2011
a(n) = ceiling(n/2) - floor(n/2). - Arkadiusz Wesolowski, Sep 16 2012
a(n) = ceiling( cos(Pi*(n-1))/2 ). - Wesley Ivan Hurt, Jun 16 2013
a(n) = floor((n-1)/2) - floor((n-2)/2). - Mikael Aaltonen, Feb 26 2015
Dirichlet g.f.: L(chi(2),s) with chi(2) the principal Dirichlet character modulo 2. - Ralf Stephan, Mar 27 2015
a(n) = 0^^n = 0^(0^(0...)) (n times), where we take 0^0 to be 1. - Natan Arie Consigli, May 02 2015
Euler transform and inverse Moebius transform of length 2 sequence [0, 1]. - Michael Somos, Feb 20 2024
Comments