cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A121262 The characteristic function of the multiples of four.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0
Offset: 0

Views

Author

Paolo P. Lava and Giorgio Balzarotti, Aug 23 2006, Aug 30 2007

Keywords

Comments

Period 4: repeat [1, 0, 0, 0].
a(n) is also the number of partitions of n where each part is four (Since the empty partition has no parts, a(0) = 1). Hence a(n) is also the number of 2-regular graphs on n vertices such that each component has girth exactly four. - Jason Kimberley, Oct 01 2011
This sequence is the Euler transformation of A185014. - Jason Kimberley, Oct 01 2011
Number of permutations satisfying -k <= p(i) - i <= r and p(i)-i not in I, i = 1..n, with k = 1, r = 3, I = {0, 1, 2}. - Vladimir Baltic, Mar 07 2012

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 82.

Crossrefs

A011765 is another version of the same sequence.
Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), A059841 (g=2), A079978 (g=3), this sequence (g=4), A079998 (g=5), A079979 (g=6), A082784 (g=7). - Jason Kimberley, Oct 14 2011

Programs

Formula

a(n) = (1/4)*(2*cos(n*Pi/2) + 1 + (-1)^n).
Additive with a(p^e) = 1 if p = 2 and e > 1, 0 otherwise.
Sequence shifted right by 2 is additive with a(p^e) = 1 if p = 2 and e = 1, 0 otherwise.
a(n) = 1 - (C(n + 1, n + (-1)^(n+1)) mod 2).
a(n) = 0^(n mod 4). - Reinhard Zumkeller, Sep 30 2008
a(n) = !(n%4). - Jaume Oliver Lafont, Mar 01 2009
a(n) = (1/4)*(1 + I^n + (-1)^n + (-I)^n). - Paolo P. Lava, May 04 2010
a(n) = ((n-1)^k mod 4 - (n-1)^(k-1) mod 4)/2, k > 2. - Gary Detlefs, Feb 21 2011
a(n) = floor(1/2*cos(n*Pi/2) + 1/2). - Gary Detlefs, May 16 2011
G.f.: 1/(1 - x^4); a(n) = (1 + (-1)^n)*(1 + i^((n-1)*n))/4, where i = sqrt(-1). - Bruno Berselli, Sep 28 2011
a(n) = floor(((n+3) mod 4)/3). - Gary Detlefs, Dec 29 2011
a(n) = floor(n/4) - floor((n-1)/4). - Tani Akinari, Oct 25 2012
a(n) = ceiling( (1/2)*cos(Pi*n/2) ). - Wesley Ivan Hurt, May 31 2013
a(n) = ((1+(-1)^(n/2))*(1+(-1)^n))/4. - Bogart B. Strauss, Jul 14 2013
a(n) = C(n-1,3) mod 2. - Wesley Ivan Hurt, Oct 07 2014
a(n) = (((n+1) mod 4) mod 3) mod 2. - Ctibor O. Zizka, Dec 11 2014
a(n) = (sin(Pi*(n+1)/2)^2)/2 + sin(Pi*(n+1)/2)/2. - Mikael Aaltonen, Jan 02 2015
E.g.f.: (cos(x) + cosh(x))/2. - Vaclav Kotesovec, Feb 15 2015
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 07 2016
a(n) = (1-sqrt(2)*cos(n*Pi/2-3*Pi/4))/2 * cos(n*Pi/2). - (found by Steve Chow) Iain Fox, Nov 16 2017
a(n) = 1-A166486(n). - Antti Karttunen, Jul 29 2018
a(n) = (1-(-1)^A142150(n+1))/2. - Adriano Caroli, Sep 28 2019

Extensions

More terms from Antti Karttunen, Jul 29 2018