login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A059841 Period 2: Repeat [1,0]. a(n) = 1 - (n mod 2); Characteristic function of even numbers. 226
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
When viewed as a triangular array, the row sum values are 0 1 1 1 2 3 3 3 4 5 5 5 6 ... (A004525).
This is the r=0 member of the r-family of sequences S_r(n) defined in A092184 where more information can be found.
Successive binomial transforms of this sequence: A011782, A007051, A007582, A081186, A081187, A081188, A081189, A081190, A060531, A081192.
Characteristic function of even numbers: a(A005843(n))=1, a(A005408(n))=0. - Reinhard Zumkeller, Sep 29 2008
This sequence is the Euler transformation of A185012. - Jason Kimberley, Oct 14 2011
a(n) is the parity of n+1. - Omar E. Pol, Jan 17 2012
Read as partial sequences, we get to A000975. - Jon Perry, Nov 11 2014
Elementary Cellular Automata rule 77 produces this sequence. See Wolfram, Weisstein and Index links below. - Robert Price, Jan 30 2016
Column k = 1 of A051159. - John Keith, Jun 28 2021
LINKS
Paul Barry, A Catalan Transform and Related Transformations on Integer Sequences, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.
Paul Barry, On Motzkin-Schröder Paths, Riordan Arrays, and Somos-4 Sequences, J. Int. Seq. (2023) Vol. 26, Art. 23.4.7.
Eric Weisstein's World of Mathematics, Elementary Cellular Automaton
FORMULA
a(n) = 1 - A000035(n). - M. F. Hasler, Jan 13 2012
From Paul Barry, Mar 11 2003: (Start)
G.f.: 1/(1-x^2).
E.g.f.: cosh(x).
a(n) = (n+1) mod 2.
a(n) = 1/2 + (-1)^n/2. (End)
Additive with a(p^e) = 1 if p = 2, 0 otherwise.
a(n) = Sum_{k=0..n} (-1)^k*A038137(n, k). - Philippe Deléham, Nov 30 2006
a(n) = Sum_{k=1..n} (-1)^(n-k) for n > 0. - William A. Tedeschi, Aug 05 2011
E.g.f.: cosh(x) = 1 + x^2/(Q(0) - x^2); Q(k) = 8k + 2 + x^2/(1 + (2k + 1)*(2k + 2)/Q(k + 1)); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
E.g.f.: cosh(x) = 1/2*Q(0); Q(k) = 1 + 1/(1 - x^2/(x^2 + (2k + 1)*(2k + 2)/Q(k + 1))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
E.g.f.: cosh(x) = E(0)/(1-x) where E(k) = 1 - x/(1 - x/(x - (2*k+1)*(2*k+2)/E(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Apr 05 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, m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = A000035(n+1) = A008619(n) - A110654(n). - Wesley Ivan Hurt, Jul 20 2013
EXAMPLE
Triangle begins:
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;
...
MAPLE
seq(1-modp(n, 2), n=0..150); # Muniru A Asiru, Apr 05 2018
MATHEMATICA
CoefficientList[Series[1/(1 - x^2), {x, 0, 104}], x] (* or *)
Array[1/2 + (-1)^#/2 &, 105, 0] (* Michael De Vlieger, Feb 19 2019 *)
Table[QBinomial[n, 1, -1], {n, 1, 74}] (* John Keith, Jun 28 2021 *)
PadRight[{}, 120, {1, 0}] (* Harvey P. Dale, Mar 06 2023 *)
PROG
(PARI) a(n)=(n+1)%2; \\ or 1-n%2 as in NAME.
(PARI) A059841(n)=!bittest(n, 0) \\ M. F. Hasler, Jan 13 2012
(Haskell)
a059841 n = (1 -) . (`mod` 2)
a059841_list = cycle [1, 0]
-- Reinhard Zumkeller, May 05 2012, Dec 30 2011
(Magma) [0^(n mod 2): n in [0..100]]; // Vincenzo Librandi, Nov 09 2014
(Python)
def A059841(n): return 1 - (n & 1) # Chai Wah Wu, May 25 2022
CROSSREFS
One's complement of A000035 (essentially the same, but shifted once).
Cf. A033999 (first differences), A008619 (partial sums), A004525, A011782 (binomial transf.), A000975.
Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), this sequence (g=2), A079978 (g=3), A121262 (g=4), A079998 (g=5), A079979 (g=6), A082784 (g=7).
Sequence in context: A015301 A016213 A015757 * A056594 A101455 A091337
KEYWORD
easy,nonn
AUTHOR
Alford Arnold, Feb 25 2001
EXTENSIONS
Better definition from M. F. Hasler, Jan 13 2012
Reinhard Zumkeller's Sep 29 2008 description added as a secondary name by Antti Karttunen, May 03 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 01:57 EDT 2024. Contains 370952 sequences. (Running on oeis4.)